I'm using wp_insert_post to dynamically generate child pages for a given page using a predefined array of values. The goal is to give each child page the same slug. For example, clicking "Generate ...
I have a function that creates a page when I create a post (so as to construct parent-child relationship trees). I'm using the $title of the post to create the page and this also creates a duplicate ...
I added slug input field in my custom post type and allow users to edit it at front end. Then, when insert post, I use this: $wp_insert_post_args = array( 'post_status' => 'publish', ...