wp_insert_post wrong post type [closed]
The problem is that your code creates a post if the created post is not manually-published, but the new post is automatically-published, and those don’t match. Your conditional is not explicit enough and eneds to skip the scenario when your inserted post is inserted to prevent an infinite loop Instead of: function create_auto_post($post_ID) { if … Read more