Make WordPress Core


Ignore:
Timestamp:
02/06/2010 10:07:57 AM (15 years ago)
Author:
markjaquith
Message:

Create post_status=auto-draft when creating a new post item. status changes to draft on first auto-save. now we always have a real post ID to work with. see #11889. fixes #11145. fixes #11990

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r12967 r12987  
    7272        break;
    7373    case 'draft':
     74    case 'auto-draft':
    7475        _e('Draft');
     76        break;
     77    case 'auto-draft':
     78        _e('Unsaved');
    7579        break;
    7680}
     
    8185
    8286<div id="post-status-select" class="hide-if-js">
    83 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
     87<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />
    8488<select name='post_status' id='post_status' tabindex='4'>
    8589<?php if ( 'publish' == $post->post_status ) : ?>
     
    9195<?php endif; ?>
    9296<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
     97<?php if ( 'auto-draft' == $post->post_status ) : ?>
     98<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     99<?php else : ?>
    93100<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     101<?php endif; ?>
    94102</select>
    95103 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
Note: See TracChangeset for help on using the changeset viewer.