[wp-trac] [WordPress Trac] #44914: Bulk Edit posts changes Post format back to Standard

WordPress Trac noreply at wordpress.org
Fri Sep 7 20:28:49 UTC 2018


#44914: Bulk Edit posts changes Post format back to Standard
-----------------------------------------+------------------------------
 Reporter:  lanche86                     |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Post Formats                 |     Version:  4.9.8
 Severity:  normal                       |  Resolution:
 Keywords:  needs-patch has-screenshots  |     Focuses:  administration
-----------------------------------------+------------------------------

Comment (by birgire):

 It looks like the problem could originate from {{{bulk_edit_posts()}}}
 ([https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-
 admin/includes/post.php#L537 src]):

 {{{
 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array(
 'fields' => 'names' ) );

 }}}

 where it fetches the post format names, like "Image" or "Video".

 Then these names are added into the {{{tax_input}}} for
 {{{wp_update_post()}}}.

 But {{{wp_set_post_terms()}}} don't know how to add post formats with
 correct slug prefix.

 One suggestion could be to consider using:

 {{{
 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array(
 'fields' => 'slugs' ) );

 }}}

 for post formats, to fetch slugs with the correct post format prefix, like
 {{{post-format-image}}} and {{{post-format-video}}}.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44914#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list