post_name empty after wp_insert_post
Firstly, you shouldn’t use post_category, because according to the wordpress codex wp_insert_post(): ‘post_category’ => [ array(, <…>) ] //post_category no longer exists, try wp_set_post_terms() for setting a post’s categories Secondly, if you want the post title to be your slug you shouldn’t need to use the post_name parameter, because it gets constructed from the title … Read more