Changeset 2496

Show
Ignore:
Timestamp:
03/29/05 19:24:37 (4 years ago)
Author:
ryan
Message:

Don't set auto-set post slug until published. http://mosquito.wordpress.org/view.php?id=1073 Props: coffee2code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r2463 r2496  
    105105    $post_ID = $id_result->Auto_increment; 
    106106 
    107     if ( empty($post_name) || 'draft' == $post_status ) { 
    108         $post_name = sanitize_title($post_title, $post_ID); 
     107    if ( empty($post_name) ) { 
     108        if ( 'draft' != $post_status ) 
     109            $post_name = sanitize_title($post_title, $post_ID); 
    109110    } else { 
    110111        $post_name = sanitize_title($post_name, $post_ID); 
     
    291292    $post_password = $_POST['post_password']; 
    292293    $post_name = $_POST['post_name']; 
    293     if (empty($post_name)) { 
    294         $post_name = $post_title; 
    295     } 
    296294 
    297295    $post_parent = 0; 
     
    309307        $post_status = 'draft'; 
    310308 
    311     if (empty($post_name) || 'draft' == $post_status ) { 
    312         $post_name = sanitize_title($post_title, $post_ID); 
     309    if ( empty($post_name) ) { 
     310        if ( 'draft' != $post_status ) 
     311            $post_name = sanitize_title($post_title, $post_ID); 
    313312    } else { 
    314313        $post_name = sanitize_title($post_name, $post_ID);