## plugins – WordPress programatically inserted post not showing in authors profile

Question

I have inserted a post programmatically in a wordpress
When viewing the post on the authors’ page, there is no post from the post that I have inserted programmatically, but when manually updating the post, it’s then working and showing properly. What will the cause and how to solve this any guide?

Code in my plugin:

        $advert_posts = array( 'post_author' =>$user_id_get,
'post_title' => $title[$i],
'post_content' => $description[$i] . $listings[$i],
$post_id = wp_insert_post($advert_posts);
$category_id = 877;$taxonomy = 'advert-category';
wp_set_object_terms( $post_id, array($category_id ), \$taxonomy , true );