WordPress at Your Fingertips
filter is not described

rest_prepare_widget filter-hook . WP 5.8.0

Filters the REST API response for a widget.

Usage

add_filter( 'rest_prepare_widget', 'filter_function_name_1617', 10, 3 );
function filter_function_name_1617( $response, $widget, $request ){
	// filter...

	return $response;
}
$response(WP_REST_Response)
The response object.
$widget(array)
The registered widget data.
$request(WP_REST_Request)
Request used to generate the response.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

WP_REST_Widgets_Controller::prepare_item_for_response()
rest_prepare_widget
wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php 673
return apply_filters( 'rest_prepare_widget', $response, $widget, $request );

Where in WP core the hook is used WordPress

Usage not found.