mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Post Formats: In bulk_edit_posts(), set post format before the post is updated, for consistency with edit_post().
This makes sure that plugins hooked to `save_post` get the right post format. Props Chouby, SergeyBiryukov. Fixes #41396. git-svn-id: https://develop.svn.wordpress.org/trunk@41187 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -564,6 +564,11 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_format'] ) ) {
|
||||
set_post_format( $post_ID, $post_data['post_format'] );
|
||||
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 ) ) {
|
||||
@@ -572,9 +577,6 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
else
|
||||
unstick_post( $post_ID );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_format'] ) )
|
||||
set_post_format( $post_ID, $post_data['post_format'] );
|
||||
}
|
||||
|
||||
return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );
|
||||
|
||||
Reference in New Issue
Block a user