WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/30/2017 02:40:42 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r40989 r41187  
    565565        }
    566566
     567        if ( isset( $post_data['post_format'] ) ) {
     568            set_post_format( $post_ID, $post_data['post_format'] );
     569            unset( $post_data['tax_input']['post_format'] );
     570        }
     571
    567572        $updated[] = wp_update_post( $post_data );
    568573
     
    573578                unstick_post( $post_ID );
    574579        }
    575 
    576         if ( isset( $post_data['post_format'] ) )
    577             set_post_format( $post_ID, $post_data['post_format'] );
    578580    }
    579581
Note: See TracChangeset for help on using the changeset viewer.