WordPress at Your Fingertips
action is not described

rest_delete_widget action-hook . WP 5.8.0

Fires after a widget is deleted via the REST API.

Usage

add_action( 'rest_delete_widget', 'action_function_name_3223', 10, 4 );
function action_function_name_3223( $widget_id, $sidebar_id, $response, $request ){
	// action...
}
$widget_id(string)
ID of the widget marked for deletion.
$sidebar_id(string)
ID of the sidebar the widget was deleted from.
$response(WP_REST_Response)
The response data.
$request(WP_REST_Request)
The request sent to the API.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

WP_REST_Widgets_Controller::delete_item()
rest_delete_widget
wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php 415
do_action( 'rest_delete_widget', $widget_id, $sidebar_id, $response, $request );

Where in WP core the hook is used WordPress

wp-includes/default-filters.php 264
add_action( $action, '_delete_option_fresh_site', 0 );