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

WordPress Trac noreply at wordpress.org
Thu Mar 14 08:14:30 UTC 2019


#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  |     Focuses:
------------------------------------+-----------------------------

Comment (by mensmaximus):

 Replying to [comment:18 mensmaximus]:
 > Imho such a hook is not necessary at all because there are three action
 hooks available to further manipulate a post after it got updated:
 `edit_post_{$post->post_type}`, `edit_post` and `post_updated`

 I did some testing and found none of these action hooks can be utilized to
 save custom data from bulk edit because `$_POST` is empty if
 `wp_insert_post()` gets invoked by `bulk_edit_posts()`.

 To save custom data from bulk edit you can use the action hook
 `wp_insert_post_data`. It passes `$postarr` as second argument containing
 all values from `$_POST`.

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


More information about the wp-trac mailing list