[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Sidebars_Controller class Original code from {@link https://github.com/martin-pettersson/wp-rest-api-sidebars Martin Pettersson (martin_pettersson@outlook.com)}.

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

Defines 1 class

WP_REST_Sidebars_Controller:: (15 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  get_item_permissions_check()
  check_read_permission()
  get_item()
  update_item_permissions_check()
  update_item()
  do_permissions_check()
  get_sidebar()
  retrieve_widgets()
  prepare_item_for_response()
  prepare_links()
  get_item_schema()


Class: WP_REST_Sidebars_Controller  - X-Ref

Core class used to manage a site's sidebars.

__construct()   X-Ref
Sidebars controller constructor.

since: 5.8.0

register_routes()   X-Ref
Registers the controllers routes.

since: 5.8.0

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

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

get_items( $request )   X-Ref
Retrieves the list of sidebars (active or inactive).

since: 5.8.0
param: WP_REST_Request $request Full details about the request.
return: WP_REST_Response Response object on success.

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

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

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

since: 5.9.0
param: array $sidebar The registered sidebar configuration.
return: bool Whether the side can be read.

get_item( $request )   X-Ref
Retrieves one sidebar from the collection.

since: 5.8.0
param: WP_REST_Request $request Full details about the request.
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 sidebars.

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

update_item( $request )   X-Ref
Updates a sidebar.

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

do_permissions_check()   X-Ref
Checks if the user has permissions to make the request.

since: 5.8.0
return: true|WP_Error True if the request has read access, WP_Error object otherwise.

get_sidebar( $id )   X-Ref
Retrieves the registered sidebar with the given id.

since: 5.8.0
param: string|int $id ID of the sidebar.
return: array|null The discovered sidebar, or null if it is not registered.

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

since: 5.9.0

prepare_item_for_response( $item, $request )   X-Ref
Prepares a single sidebar output for response.

since: 5.8.0
since: 5.9.0 Renamed `$raw_sidebar` to `$item` to match parent class for PHP 8 named parameter support.
param: array           $item    Sidebar instance.
param: WP_REST_Request $request Full details about the request.
return: WP_REST_Response Prepared response object.

prepare_links( $sidebar )   X-Ref
No description

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

since: 5.8.0
return: array Item schema data.



Generated: Tue Jun 28 01:00:03 2022 Cross-referenced by PHPXref 0.7.1