Wordpress push post in category from php -


i have conditional statement , when condition becomes true want push specific post specific category.

something wp_push_post($post, $category)

does exists function makes job?

use

 <?php wp_insert_post( $post, $wp_error ); ?>  

with

$post = array(   'id' => [ <post id> ] //are updating existing post?   'menu_order' => [ <order> ] //if new post page, sets order should appear in tabs.   'comment_status' => [ 'closed' | 'open' ] // 'closed' means no comments.   'ping_status' => [ 'closed' | 'open' ] // 'closed' means pingbacks or trackbacks turned off   'pinged' => [ ? ] //?   'post_author' => [ <user id> ] //the user id number of author.   'post_category' => [ array(<category id>, <...>) ] //add categories.   'post_content' => [ <the text of post> ] //the full text of post.   'post_date' => [ y-m-d h:i:s ] //the time post made.   'post_date_gmt' => [ y-m-d h:i:s ] //the time post made, in gmt.   'post_excerpt' => [ <an excerpt> ] //for post excerpt needs.   'post_name' => [ <the name> ] // name (slug) post   'post_parent' => [ <post id> ] //sets parent of new post.   'post_password' => [ ? ] //password post?   'post_status' => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' ] //set status of new post.    'post_title' => [ <the title> ] //the title of post.   'post_type' => [ 'post' | 'page' | 'link' | 'nav_menu_item' | custom post type ] //you may want insert regular post, page, link, menu item or custom post type   'tags_input' => [ '<tag>, <tag>, <...>' ] //for tags.   'to_ping' => [ ? ] //?   'tax_input' => [ array( 'taxonomy_name' => array( 'term', 'term2', 'term3' ) ) ] // support custom taxonomies.  );   

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -