I am trying to add a new post using the function wp_inser_post
in one of my existing categories, I've created a new taxonomy named categorie
and in that taxonomy i have a few categories, and I am not able to find a solution, the post is being added but no category is selected.
$title = $_POST['postTitle'];
$description = $_POST['postContent'];
$new_post = array(
'post_title' => esc_attr(strip_tags($title)),
'post_content' => esc_attr(strip_tags($description)),
'post_type' => 'proiecte',
'post_status' => 'publish',
'post_category' => array(17,16),
'taxonomy' => 'categorie'
);
$post_id = wp_insert_post($new_post);