Make WordPress Core

Ticket #27792: 27792.diff

File 27792.diff, 1.0 KB (added by nacin, 11 years ago)

Untested

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

     
    450450                $post_data['post_type'] = $post->post_type;
    451451                $post_data['post_mime_type'] = $post->post_mime_type;
    452452                $post_data['guid'] = $post->guid;
     453                $post_data['ID'] = $post_ID;
     454                $post_data['post_ID'] = $post_ID;
    453455
     456                $translated_post_data = $post_data;
     457
    454458                foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) {
    455459                        if ( ! isset( $post_data[ $field ] ) ) {
    456                                 $post_data[ $field ] = $post->$field;
     460                                $translated_post_data[ $field ] = $post->$field;
    457461                        }
    458462                }
    459463
    460                 $post_data['ID'] = $post_ID;
    461                 $post_data['post_ID'] = $post_ID;
    462 
    463                 $translated_post_data = _wp_translate_postdata( true, $post_data );
     464                $translated_post_data = _wp_translate_postdata( true, $translated_post_data );
    464465                if ( is_wp_error( $translated_post_data ) ) {
    465466                        $skipped[] = $post_ID;
    466467                        continue;