[ 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: 807 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Widgets_Controller:: (18 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  get_item_permissions_check()
  get_item()
  create_item_permissions_check()
  create_item()
  update_item_permissions_check()
  update_item()
  delete_item_permissions_check()
  delete_item()
  permissions_check()
  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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
return: string|WP_Error The saved widget ID.

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

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

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

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

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

since: 5.8.0
return: array[]

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

since: 5.8.0
return: array Item schema data.



Generated: Mon Sep 20 01:00:04 2021 Cross-referenced by PHPXref 0.7.1