WordPress.org

Make WordPress Core

Ticket #15511: post.diff

File post.diff, 657 bytes (added by alexdunae, 4 years ago)
  • wp-admin/includes/post.php

     
    156156        } 
    157157 
    158158        $post_data = _wp_translate_postdata( true, $post_data ); 
     159        if ( is_wp_error($post_data) ) 
     160                wp_die( $post_data->get_error_message() ); 
    159161        if ( 'autosave' != $post_data['action']  && 'auto-draft' == $post_data['post_status'] ) 
    160162                $post_data['post_status'] = 'draft'; 
    161         if ( is_wp_error($post_data) ) 
    162                 wp_die( $post_data->get_error_message() ); 
    163163 
    164164        if ( isset($post_data['visibility']) ) { 
    165165                switch ( $post_data['visibility'] ) {