Make WordPress Core

Changeset 28115 for branches/3.7/src


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

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

Merges [28113] to the 3.7 branch.

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

props dd32, DrewAPicture.
fixes #27792.

Location:
branches/3.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

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

    r28074 r28115  
    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.