Skip to content

Commit a46baca

Browse files
committed
REST API: Add 'delete_widget' action to delete widget endpoint
Triggers the 'delete_widget' action to the delete widget endpoint in the REST API. This aligns with the behaviour in the widgets WP Admin screen. Fixes #53289. Props isabel_brison, TimothyBlynJacobs. git-svn-id: https://develop.svn.wordpress.org/trunk@51060 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 08d48b9 commit a46baca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ public function delete_item( $request ) {
321321
);
322322
$_REQUEST = $_POST;
323323

324+
/** This action is documented in wp-admin/widgets-form.php */
325+
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
326+
324327
$callback = $wp_registered_widget_updates[ $id_base ]['callback'];
325328
$params = $wp_registered_widget_updates[ $id_base ]['params'];
326329

0 commit comments

Comments
 (0)