From 6abd89a64365c55625359ec9bcb2908580328c78 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@2496 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 837b9b36ce..6c9984c4de 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); }