mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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
This commit is contained in:
parent
83a8a56f73
commit
8007e707c8
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user