It looks like you’re trying to use the default Post
post type’s Category
taxonomy with your custom post type movies
.
$post_info = array(
'post_type' => 'movies', // custom post type here
'post_status' => 'pending',
'post_title' => esc_attr(strip_tags($_POST['title'])),
'post_content' => esc_attr(strip_tags($_POST['overview'])),
'post_category' => $category, // categories are by default only for Post post type
);
Have you already added such code to your site, which allows you to use the default Category
taxonomy with your custom post type? If not, have a look here on how to do it, tags & categories with custom post type
If you have registered a custom taxonomy for your movies
post type, then you should use tax_input
in your $post_info
array. Like so,
$post_info = array(
'post_type' => 'movies',
'post_status' => 'pending',
'post_title' => esc_attr(strip_tags($_POST['title'])),
'post_content' => esc_attr(strip_tags($_POST['overview'])),
'tax_input' => array(
'some_custom_taxonomy' => $category
),
);