Make WordPress Core


Ignore:
Timestamp:
04/14/2014 08:10:14 AM (12 years ago)
Author:
nacin
Message:

Avoid stomping of bulk postdata inside the bulk_edit_posts() loop.

Merge [28113] to the 3.8 branch.

Reverts [27991] which did not fix it for authors and comment/ping status.

props dd32, DrewAPicture.
fixes #27792.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

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

    r28073 r28114  
    412412
    413413        $updated = $skipped = $locked = array();
     414        $shared_post_data = $post_data;
     415
    414416        foreach ( $post_IDs as $post_ID ) {
     417                // Start with fresh post data with each iteration.
     418                $post_data = $shared_post_data;
     419
    415420                $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
    416421
     
    461466                $post_data['post_ID'] = $post_ID;
    462467
    463                 $translated_post_data = _wp_translate_postdata( true, $post_data );
    464                 if ( is_wp_error( $translated_post_data ) ) {
     468                $post_data = _wp_translate_postdata( true, $post_data );
     469                if ( is_wp_error( $post_data ) ) {
    465470                        $skipped[] = $post_ID;
    466471                        continue;
    467472                }
    468473
    469                 $updated[] = wp_update_post( $translated_post_data );
     474                $updated[] = wp_update_post( $post_data );
    470475
    471476                if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
Note: See TracChangeset for help on using the changeset viewer.