WordPress.org

Make WordPress Core

Opened 5 days ago

Last modified 3 days ago

#54498 assigned defect (bug)

New FSE REST Endpoints may need to manually call `wp_after_insert_post()`

Reported by: peterwilsoncc Owned by: spacedmonkey
Milestone: 5.9 Priority: normal
Severity: normal Version: trunk
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:

Description

The following REST API endpoints used for FSE store data in the post table and may need to be altered to manually call wp_after_insert_post() after disabling it as part of the call to wp_insert_post() and related functions.

The purpose of the wp_after_insert_post hook (fired by the function of the same name) is to fire after all data for a post has been updated: the post object, the terms and the meta data.

  • WP_REST_Global_Styles_Controller::update_item() may update meta data after the call to wp_update_post()
  • WP_REST_Menu_Items_Controller both for create and update methods. This may require changes to the signature for wp_update_nav_menu_item()
  • WP_REST_Templates_Controller both for create and update methods.

I've put this on the 5.9 milestone for consideration as it relates to the FSE features.

Change History (9)

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


4 days ago

This ticket was mentioned in Slack in #core-restapi by antonvlasenko. View the logs.


4 days ago

#3 @spacedmonkey
4 days ago

  • Focuses rest-api added
  • Keywords needs-patch added
  • Owner set to spacedmonkey
  • Status changed from new to assigned
  • Version set to trunk

This ticket was mentioned in Slack in #core-restapi by zieladam. View the logs.


4 days ago

This ticket was mentioned in PR #1951 on WordPress/wordpress-develop by spacedmonkey.


3 days ago

  • Keywords has-patch added; needs-patch removed

#8 @spacedmonkey
3 days ago

@peterwilsoncc @TimothyBlynJacobs I have created PRs for all the endpoints. I created PRs for all the different endpoints for easier review.

Once, I get a positive review from any of the PRs, I will commit the changes, as this change is simple and harmless.

I created a related issue #54520 on a very similar matter. I would also like to get eyes on this as well.

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


3 days ago

Note: See TracTickets for help on using tickets.