Make WordPress Core

Ticket #27792: 27792.3.diff

File 27792.3.diff, 1.2 KB (added by nacin, 11 years ago)
  • src/wp-admin/includes/post.php

     
    433433        }
    434434
    435435        $updated = $skipped = $locked = array();
     436        $shared_post_data = $post_data;
     437
    436438        foreach ( $post_IDs as $post_ID ) {
     439                // Start with fresh post data with each iteration.
     440                $post_data = $shared_post_data;
     441
    437442                $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
    438443
    439444                if ( !isset( $post_type_object ) || ( isset($children) && in_array($post_ID, $children) ) || !current_user_can( 'edit_post', $post_ID ) ) {
     
    482487                $post_data['ID'] = $post_ID;
    483488                $post_data['post_ID'] = $post_ID;
    484489
    485                 $translated_post_data = _wp_translate_postdata( true, $post_data );
    486                 if ( is_wp_error( $translated_post_data ) ) {
     490                $post_data = _wp_translate_postdata( true, $post_data );
     491                if ( is_wp_error( $post_data ) ) {
    487492                        $skipped[] = $post_ID;
    488493                        continue;
    489494                }
    490495
    491                 $updated[] = wp_update_post( $translated_post_data );
     496                $updated[] = wp_update_post( $post_data );
    492497
    493498                if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
    494499                        if ( 'sticky' == $post_data['sticky'] )