Skip to content
My Experiments with WordPress
$post_id = 1; // Adding category to the post $category_ids = array(4, 5, 6); wp_set_object_terms( $post_id, $category_ids, 'category'); // Adding tags to the post $tag_ids = array(7, 8, 9); wp_set_object_terms( $post_id, $tag_ids, 'post_tag');
2 Comments
Categories: .
Whats the filter or action to call this?
It can be added anywhere after the core API (taxonomy functions) is loaded. Not sure if you were asking for this.
Leave a Reply Cancel Some HTML is OK
Name (required)
Email (required, but never shared)
Web
or, reply to this post via trackback.
Currently you have JavaScript disabled. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page. Click here for instructions on how to enable JavaScript in your browser.
Whats the filter or action to call this?
It can be added anywhere after the core API (taxonomy functions) is loaded. Not sure if you were asking for this.