[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-widgets-controller.php (summary)

REST API: WP_REST_Widgets_Controller class

File Size: 874 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Widgets_Controller:: (20 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  get_item_permissions_check()
  check_read_sidebar_permission()
  get_item()
  create_item_permissions_check()
  create_item()
  update_item_permissions_check()
  update_item()
  delete_item_permissions_check()
  delete_item()
  permissions_check()
  retrieve_widgets()
  save_widget()
  prepare_item_for_response()
  prepare_links()
  get_collection_params()
  get_item_schema()


Class: WP_REST_Widgets_Controller  - X-Ref

Core class to access widgets via the REST API.

__construct()   X-Ref
Widgets controller constructor.

since: 5.8.0

register_routes()   X-Ref
Registers the widget routes for the controller.

since: 5.8.0

get_items_permissions_check( $request )   X-Ref
Checks if a given request has access to get widgets.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

get_items( $request )   X-Ref
Retrieves a collection of widgets.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to get a widget.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

check_read_sidebar_permission( $sidebar_id )   X-Ref
Checks if a sidebar can be read publicly.

return: bool Whether the sidebar can be read.
param: string $sidebar_id The sidebar ID.
since: 5.9.0

get_item( $request )   X-Ref
Gets an individual widget.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

create_item_permissions_check( $request )   X-Ref
Checks if a given request has access to create widgets.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

create_item( $request )   X-Ref
Creates a widget.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

update_item_permissions_check( $request )   X-Ref
Checks if a given request has access to update widgets.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

update_item( $request )   X-Ref
Updates an existing widget.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

delete_item_permissions_check( $request )   X-Ref
Checks if a given request has access to delete widgets.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

delete_item( $request )   X-Ref
Deletes a widget.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

permissions_check( $request )   X-Ref
Performs a permissions check for managing widgets.

return: true|WP_Error
param: WP_REST_Request $request Full details about the request.
since: 5.8.0

retrieve_widgets()   X-Ref
Looks for "lost" widgets once per request.

since: 5.9.0

save_widget( $request, $sidebar_id )   X-Ref
Saves the widget in the request object.

return: string|WP_Error The saved widget ID.
param: WP_REST_Request $request    Full details about the request.
param: string          $sidebar_id ID of the sidebar the widget belongs to.
since: 5.8.0

prepare_item_for_response( $item, $request )   X-Ref
Prepares the widget for the REST response.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: array           $item    An array containing a widget_id and sidebar_id.
param: WP_REST_Request $request Request object.
since: 5.8.0

prepare_links( $prepared )   X-Ref
Prepares links for the widget.

return: array Links for the given widget.
param: array $prepared Widget.
since: 5.8.0

get_collection_params()   X-Ref
Gets the list of collection params.

return: array[]
since: 5.8.0

get_item_schema()   X-Ref
Retrieves the widget's schema, conforming to JSON Schema.

return: array Item schema data.
since: 5.8.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1