WP_REST_Widget_Types_Controller
- Since
- 5.8.0
- Source
wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php:17
Core class to access widget types via the REST API.
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).
Hooks and filters fired · 5
Every hook that fires from inside WP_REST_Widget_Types_Controller, in the order it appears in the class, grouped by the method that fires it.
WP_REST_Widget_Types_Controller::prepare_item_for_response()
- apply_filters( rest_prepare_widget_type )filter line 309
- apply_filters( rest_prepare_widget_type )filter line 363
WP_REST_Widget_Types_Controller::encode_form_data()
- apply_filters( widget_update_callback )filter line 513
WP_REST_Widget_Types_Controller::get_widget_form()
- apply_filters( widget_form_callback )filter line 582
- do_action( in_widget_form )action line 592
Methods · 18
- __construct()Constructor.
- register_routes()Registers the widget type routes.
- get_items_permissions_check()Checks whether a given request has permission to read widget types.
- get_items()Retrieves the list of all widget types.
- get_item_permissions_check()Checks if a given request has access to read a widget type.
- check_read_permission()Checks whether the user can read widget types.
- get_widget()Gets the details about the requested widget.
- get_widgets()Normalize array of widgets.
- get_item()Retrieves a single widget type from the collection.
- prepare_item_for_response()Prepares a widget type object for serialization.
- prepare_links()Prepares links for the widget type.
- get_item_schema()Retrieves the widget type's schema, conforming to JSON Schema.
- encode_form_data()An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object.
- get_widget_preview()Returns the output of WP_Widget::widget() when called with the provided instance. Used by encode_form_data() to preview a widget.
- get_widget_form()Returns the output of WP_Widget::form() when called with the provided instance. Used by encode_form_data() to preview a widget's form.
- render()Renders a single Legacy Widget and wraps it in a JSON-encodable array.
- render_legacy_widget_preview_iframe()Renders a page containing a preview of the requested Legacy Widget block.
- get_collection_params()Retrieves the query params for collections.
Changelog
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 7.1.0 tag, from
src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php, 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.