WordPress.org

Make WordPress Core

Changeset 2496


Ignore:
Timestamp:
03/29/2005 07:24:37 PM (15 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.