apply_filters( 'rest_prepare_widget', WP_REST_Response|WP_Error $response, array $widget, WP_REST_Request $request )
- Since
- 5.8.0
Filters the REST API response for a widget.
Compatibility
- WordPress
- since 5.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$responseWP_REST_Response|WP_Error- The response object, or WP_Error object on failure.
$widgetarray- The registered widget data.
$requestWP_REST_Request- Request used to generate the response.
Where this hook fires · 1
wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php:742WP_REST_Widgets_Controller::prepare_item_for_response()
Source code
* @since 5.8.0 * * @param WP_REST_Response|WP_Error $response The response object, or WP_Error object on failure. * @param array $widget The registered widget data. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_widget', $response, $widget, $request ); } /** * Prepares links for the widget. * * @since 5.8.0Changelog
Introduced in 5.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.