How can i create unique slug while inserting a new post..
I know i can query posts and compare the records to create unique slug but
I want to insert a post with unique slug at the same time.
Lets say i have post title and needed data for the post and want to insert it with wpquery Does wordpress have a function to handle all by itself..
When i insert a post with st. like
$my_post = array( 'post_title' => 'My post', 'post_content' => 'This is my post.', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array(8,39) ); // Insert the post into the database wp_insert_post( $my_post );
Doest it handle the slug automatically..
I want to insert this post and open it with php redirect after insert..