[wp-trac] [WordPress Trac] #54498: New FSE REST Endpoints may need to manually call `wp_after_insert_post()`

WordPress Trac noreply at wordpress.org
Tue Nov 30 01:12:41 UTC 2021


#54498: New FSE REST Endpoints may need to manually call `wp_after_insert_post()`
---------------------------+---------------------------
 Reporter:  peterwilsoncc  |       Owner:  spacedmonkey
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  5.9
Component:  REST API       |     Version:  trunk
 Severity:  normal         |  Resolution:  fixed
 Keywords:  has-patch      |     Focuses:  rest-api
---------------------------+---------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 This was committed in [52276] but with the wrong ticket annotation:

 > REST API: Fire `wp_after_insert_post` later in new post object
 endpoints.
 >
 > In the new menu items, global items and template controllers manually
 call the function `wp_after_insert_post()` to manually fire the action of
 the same name after all potential data is updated.
 >
 > This accounts for the use case in which a theme or plugin developer has
 modified the endpoints use of either taxonomy or meta data.
 >
 > The new parameter `$fire_after_hooks` is added to
 `wp_update_nav_menu_item()` to control whether the `wp_after_insert_post`
 action is fired when it in turn calls `wp_insert_post()`.
 >
 > Props spacedmonkey, peterwilsoncc, zieladam.

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


More information about the wp-trac mailing list