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

Merges [27990] to the 3.7 branch.

props kovshenin.
see [27964], see #27452.

Built from https://develop.svn.wordpress.org/branches/3.7@27992


git-svn-id: http://core.svn.wordpress.org/branches/3.7@27822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-04-07 19:36:21 +00:00
parent c322ca97ad
commit e5ba4e75cb
1 changed files with 3 additions and 3 deletions

View File

@ -460,13 +460,13 @@ function bulk_edit_posts( $post_data = null ) {
$post_data['ID'] = $post_ID;
$post_data['post_ID'] = $post_ID;
$post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error( $post_data ) ) {
$translated_post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error( $translated_post_data ) ) {
$skipped[] = $post_ID;
continue;
}
$updated[] = wp_update_post( $post_data );
$updated[] = wp_update_post( $translated_post_data );
if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( 'sticky' == $post_data['sticky'] )