WPDev.one
Core Class

WP_REST_Widgets_Controller

class WP_REST_Widgets_Controller // Constructor: function Object() { [native code] }

Core class to access widgets via the REST API.

Methods 20 methods

Method / Return Description
__construct()
void

Widgets controller constructor.

register_routes()
void

Registers the widget routes for the controller.

get_items_permissions_check()
(true

Checks if a given request has access to get widgets.

Parameters: $request: mixed
get_items()
WP_REST_Response

Retrieves a collection of widgets.

Parameters: $request: mixed
get_item_permissions_check()
(true

Checks if a given request has access to get a widget.

Parameters: $request: mixed
check_read_sidebar_permission()
bool

Checks if a sidebar can be read publicly.

Parameters: $sidebar_id: mixed
get_item()
(WP_REST_Response

Gets an individual widget.

Parameters: $request: mixed
create_item_permissions_check()
(true

Checks if a given request has access to create widgets.

Parameters: $request: mixed
create_item()
(WP_REST_Response

Creates a widget.

Parameters: $request: mixed
update_item_permissions_check()
(true

Checks if a given request has access to update widgets.

Parameters: $request: mixed
update_item()
(WP_REST_Response

Updates an existing widget.

Parameters: $request: mixed
delete_item_permissions_check()
(true

Checks if a given request has access to delete widgets.

Parameters: $request: mixed
delete_item()
(WP_REST_Response

Deletes a widget.

Parameters: $request: mixed
permissions_check()
(true

Performs a permissions check for managing widgets.

Parameters: $request: mixed
retrieve_widgets()
void

Looks for "lost" widgets once per request.

save_widget()
(string

Saves the widget in the request object.

Parameters: $request: mixed, $sidebar_id: mixed
prepare_item_for_response()
(WP_REST_Response

Prepares the widget for the REST response.

Parameters: $item: mixed, $request: mixed
prepare_links()
array

Prepares links for the widget.

Parameters: $prepared: mixed
get_collection_params()
array[]

Gets the list of collection params.

get_item_schema()
array

Retrieves the widget's schema, conforming to JSON Schema.

Properties

Property / Type Description
$widgets_retrieved
mixed
public
No description available.
$allow_batch
mixed
public
No description available.

Class Information

Since Version
5.8.0
Source File
wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php
Advertisement