How to set post slug when using wp_insert_post();?

The parameter to insert a custom slug is:

'post_name' => 'my-custom-slug'

Not post_slug as one would think! 🙂

Leave a Comment