From 8007e707c856c57c353c76ea9a90638ea1cc1e09 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 29 Mar 2005 19:24:37 +0000 Subject: [PATCH] Don't set auto-set post slug until published. http://mosquito.wordpress.org/view.php?id=1073 Props: coffee2code git-svn-id: http://svn.automattic.com/wordpress/trunk@2496 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index 837b9b36c..6c9984c4d 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -104,8 +104,9 @@ case 'post': $id_result = $wpdb->get_row("SHOW TABLE STATUS LIKE '$wpdb->posts'"); $post_ID = $id_result->Auto_increment; - if ( empty($post_name) || 'draft' == $post_status ) { - $post_name = sanitize_title($post_title, $post_ID); + if ( empty($post_name) ) { + if ( 'draft' != $post_status ) + $post_name = sanitize_title($post_title, $post_ID); } else { $post_name = sanitize_title($post_name, $post_ID); } @@ -290,9 +291,6 @@ case 'editpost': //if (!$_POST['ping_status']) $ping_status = get_settings('default_ping_status'); $post_password = $_POST['post_password']; $post_name = $_POST['post_name']; - if (empty($post_name)) { - $post_name = $post_title; - } $post_parent = 0; if (isset($_POST['parent_id'])) { @@ -308,8 +306,9 @@ case 'editpost': if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) ) $post_status = 'draft'; - if (empty($post_name) || 'draft' == $post_status ) { - $post_name = sanitize_title($post_title, $post_ID); + if ( empty($post_name) ) { + if ( 'draft' != $post_status ) + $post_name = sanitize_title($post_title, $post_ID); } else { $post_name = sanitize_title($post_name, $post_ID); }