My code
$post = array(
'post_title' => "hello-world",
'post_name' => "hello-world-mytext-here",
'post_content' => "bla bla bla,
'post_status' => 'pending',
'post_type' => 'my_item' //custom post type
);
$pid = wp_insert_post($post);
The problem is :
- When I am trying to insert like Administrator -> post_name works as well ! So, post slug changed like I want.
- If I do log-in like user and trying to insert post, the post_name had same slug like a title ! Without my addition text.
Where I wrong ?