WordPress.org

Make WordPress Core

Ticket #27734: 27734.diff

File 27734.diff, 989 bytes (added by dd32, 7 years ago)

Convert auto-draft to draft AFTER _wp_translate_post_data() has set the post status..

  • src/wp-admin/includes/post.php

     
    203203                        _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );
    204204        }
    205205
    206         if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) {
    207                 $post_data['post_status'] = 'draft';
    208         }
    209 
    210206        if ( isset($post_data['visibility']) ) {
    211207                switch ( $post_data['visibility'] ) {
    212208                        case 'public' :
     
    227223        if ( is_wp_error($post_data) )
    228224                wp_die( $post_data->get_error_message() );
    229225
     226        if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) {
     227                $post_data['post_status'] = 'draft';
     228        }
     229
    230230        // Post Formats
    231231        if ( isset( $post_data['post_format'] ) )
    232232                set_post_format( $post_ID, $post_data['post_format'] );