Don't make post slug sticky until the post is published. http://mosquito.wordpress.org/view.php?id=531

git-svn-id: http://svn.automattic.com/wordpress/trunk@2426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-10 03:01:45 +00:00
parent 53eef6d943
commit 1996a5986f

View File

@ -104,7 +104,7 @@ case 'post':
$id_result = $wpdb->get_row("SHOW TABLE STATUS LIKE '$wpdb->posts'");
$post_ID = $id_result->Auto_increment;
if ( empty($post_name) ) {
if ( empty($post_name) || 'draft' == $post_status ) {
$post_name = sanitize_title($post_title, $post_ID);
} else {
$post_name = sanitize_title($post_name, $post_ID);
@ -308,7 +308,7 @@ case 'editpost':
if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) && 2 != get_option('new_users_can_blog') )
$post_status = 'draft';
if (empty($post_name)) {
if (empty($post_name) || 'draft' == $post_status ) {
$post_name = sanitize_title($post_title, $post_ID);
} else {
$post_name = sanitize_title($post_name, $post_ID);