WordPress.org

Make WordPress Core

Ticket #13133: 13133.1.diff

File 13133.1.diff, 449 bytes (added by jbsil, 5 years ago)

logic: If !autosave && status == 'auto-draft' then status = 'draft' in edit_post()

  • post.php

     
    156156        } 
    157157 
    158158        $post_data = _wp_translate_postdata( true, $post_data ); 
     159        if ( 'autosave' != $post_data['action']  && 'auto-draft' == $post_data['post_status'] ) { 
     160                $post_data['post_status'] = 'draft'; 
     161        } 
    159162        if ( is_wp_error($post_data) ) 
    160163                wp_die( $post_data->get_error_message() ); 
    161164