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
This commit is contained in:
Sergey Biryukov 2019-01-21 18:05:50 +00:00
parent 5c86facd5d
commit e992ae3ea2
2 changed files with 4 additions and 2 deletions

View File

@ -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 ) ) {

View File

@ -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.