WordPress.org

Make WordPress Core

Ticket #27795: 27795.patch

File 27795.patch, 769 bytes (added by SergeyBiryukov, 7 years ago)
  • src/wp-admin/includes/post.php

     
    112112                if ( ! in_array( $previous_status, $published_statuses ) || !current_user_can( 'edit_post', $post_id ) )
    113113                        $post_data['post_status'] = 'pending';
    114114
    115         if ( ! isset($post_data['post_status']) )
    116                 $post_data['post_status'] = $previous_status;
     115        if ( ! isset( $post_data['post_status'] ) ) {
     116                $post_data['post_status'] = 'auto-draft' === $previous_status ? 'draft' : $previous_status;
     117        }
    117118
    118119        if ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) {
    119120                unset( $post_data['post_password'] );