Make WordPress Core


Ignore:
Timestamp:
04/14/2014 07:47:10 AM (11 years ago)
Author:
nacin
Message:

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

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

props dd32, DrewAPicture.
fixes #27792.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r27990 r28113  
    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
     
    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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.