WP_REST_Widget_Types_Controller
class WP_REST_Widget_Types_Controller
// Constructor: function Object() { [native code] } Core class to access widget types via the REST API.
Methods 18 methods
| Method / Return | Description |
|---|---|
| __construct() void | Constructor. |
| register_routes() void | Registers the widget type routes. |
| get_items_permissions_check() (true | Checks whether a given request has permission to read widget types.
Parameters: $request: mixed |
| get_items() (WP_REST_Response | Retrieves the list of all widget types.
Parameters: $request: mixed |
| get_item_permissions_check() (true | Checks if a given request has access to read a widget type.
Parameters: $request: mixed |
| check_read_permission() (true | Checks whether the user can read widget types. |
| get_widget() (array | Gets the details about the requested widget.
Parameters: $id: mixed |
| get_widgets() array | Normalize array of widgets. |
| get_item() (WP_REST_Response | Retrieves a single widget type from the collection.
Parameters: $request: mixed |
| prepare_item_for_response() WP_REST_Response | Prepares a widget type object for serialization.
Parameters: $item: mixed, $request: mixed |
| prepare_links() array | Prepares links for the widget type.
Parameters: $widget_type: mixed |
| get_item_schema() array | Retrieves the widget type's schema, conforming to JSON Schema. |
| encode_form_data() (WP_REST_Response | An RPC-style endpoint which can be used by clients to turn user input in
Parameters: $request: mixed |
| get_widget_preview() string | Returns the output of WP_Widget::widget() when called with the provided
Parameters: $widget: mixed, $instance: mixed |
| get_widget_form() string | Returns the output of WP_Widget::form() when called with the provided
Parameters: $widget_object: mixed, $instance: mixed |
| render() array | Renders a single Legacy Widget and wraps it in a JSON-encodable array.
Parameters: $request: mixed |
| render_legacy_widget_preview_iframe() string | Renders a page containing a preview of the requested Legacy Widget block.
Parameters: $id_base: mixed, $instance: mixed |
| get_collection_params() array | Retrieves the query params for collections. |