From e992ae3ea291506995870b659dfbfb59545ca476 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 21 Jan 2019 18:05:50 +0000 Subject: [PATCH] Post Formats: Prevent Bulk Edit from unintentionally changing post format to Standard even if set to "No change". Correct the logic in [41187]. Props birgire, mukesh27, lanche86. Fixes #44914. See #41396. Built from https://develop.svn.wordpress.org/trunk@44670 git-svn-id: http://core.svn.wordpress.org/trunk@44501 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 7a1e2a81b4..0e19876e51 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -610,9 +610,11 @@ function bulk_edit_posts( $post_data = null ) { if ( isset( $shared_post_data['post_format'] ) ) { set_post_format( $post_ID, $shared_post_data['post_format'] ); - unset( $post_data['tax_input']['post_format'] ); } + // Prevent wp_insert_post() from overwriting post format with the old data. + unset( $post_data['tax_input']['post_format'] ); + $updated[] = wp_update_post( $post_data ); if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index ae3adbeb18..625bb0c6f3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44669'; +$wp_version = '5.1-beta1-44670'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.