Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#54520 closed defect (bug) (fixed)

Ensure that rest_after_insert_ actions are fired in template REST API controllers

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.8
Component: REST API Keywords: has-patch
Focuses: Cc:


The template REST API controller, does not extend the post controller class. So the dynamic action rest_after_insert_$this->post_type is never fired. The WP_REST_Templates_Controller class should be updated to include this action.

Change History (5)

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

2 years ago

  • Keywords has-patch added

#2 @spacedmonkey
2 years ago

  • Owner set to spacedmonkey
  • Status changed from new to assigned

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

2 years ago

#4 @spacedmonkey
2 years ago

#54519 was marked as a duplicate.

#5 @spacedmonkey
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52268:

REST API: Ensure that the rest_after_insert_ action is executed in the templates controller.

Fire the that dynamic action rest_after_insert_{$this->post_type} in templates controller, as this action is fired in other post based REST API controllers.

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54520.

Note: See TracTickets for help on using tickets.