[wp-trac] [WordPress Trac] #28112: bulk_edit_posts() function needs an action hook

WordPress Trac noreply at wordpress.org
Tue Jun 14 09:15:21 UTC 2022

#28112: bulk_edit_posts() function needs an action hook
 Reporter:  helgatheviking                       |       Owner:  (none)
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Quick/Bulk Edit                      |     Version:  3.9
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback has-patch reporter-     |     Focuses:
  feedback                                       |
Changes (by costdev):

 * keywords:  dev-feedback has-patch => dev-feedback has-patch reporter-


 I believe @mensmaximus is correct regarding available hooks:

 wp_insert_attachment_data] for attachments.
 - [https://developer.wordpress.org/reference/hooks/wp_insert_post_data/
 wp_insert_post_data] for everything else.

 However, hooking these filters means the callback will run on each insert
 - something that might be undesirable. For this reason, the proposed
 action hook would be more appropriate.

 The action hook in the patch ''may'' need to use `$shared_data`, because
 `$post_data` is extended with data for each post in the `foreach` loop,
 and this additional data would only be for the last post in the loop.
 @helgatheviking, @Mte90, what do you think about this?

Ticket URL: <https://core.trac.wordpress.org/ticket/28112#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list