- This topic has 0 replies, 1 voice, and was last updated 1 year, 1 month ago by .
-
Topic
-
How to insert a custom post into a custom category?
$post_data = array( 'post_title' => '...', 'post_content' => '...', 'post_type' => 'my-post-type', 'post_status' => 'publish', 'post_author' => 1, 'tax_input' => array( 'my-custon-category' => array( $my_id ) ) ); $post_id = wp_insert_post( $post_data, true);
- You must be logged in to reply to this topic.