1
vote
0answers
282 views

wp_insert_post - How do I prevent incremental numbers on child pages?

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 ...
2
votes
3answers
888 views

How to prevent duplicate slugs for wp_insert_post?

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 ...
0
votes
1answer
184 views

Is this the correct way to add post-slug input field?

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', ...