wp_insert_post inserts 3 posts at once?
Thanks to @TomJNowell’s hint I managed to get it working with a simple check if the post already exists (using the post_exists function). This code is included in the functions.php file. Additionally, the loop only runs if called from the backend using the is_admin function. Here’s the working example: function ekesto_insert_post(){ // config $post_type=”event”; // … Read more