[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Block_Types_Controller class

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

Defines 1 class

WP_REST_Block_Types_Controller:: (12 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  get_item_permissions_check()
  check_read_permission()
  get_block()
  get_item()
  prepare_item_for_response()
  prepare_links()
  get_item_schema()
  get_collection_params()


Class: WP_REST_Block_Types_Controller  - X-Ref

Core class used to access block types via the REST API.

__construct()   X-Ref
Constructor.

since: 5.5.0

register_routes()   X-Ref
Registers the routes for block types.

since: 5.5.0

get_items_permissions_check( $request )   X-Ref
Checks whether a given request has permission to read post block types.

since: 5.5.0
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.

get_items( $request )   X-Ref
Retrieves all post block types, depending on user context.

since: 5.5.0
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.

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read a block type.

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

check_read_permission()   X-Ref
Checks whether a given block type should be visible.

since: 5.5.0
return: true|WP_Error True if the block type is visible, WP_Error otherwise.

get_block( $name )   X-Ref
Get the block, if the name is valid.

since: 5.5.0
return: WP_Block_Type|WP_Error Block type object if name is valid, WP_Error otherwise.
param: string $name Block name.

get_item( $request )   X-Ref
Retrieves a specific block type.

since: 5.5.0
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.

prepare_item_for_response( $item, $request )   X-Ref
Prepares a block type object for serialization.

since: 5.5.0
since: 5.9.0 Renamed `$block_type` to `$item` to match parent class for PHP 8 named parameter support.
return: WP_REST_Response Block type data.
param: WP_Block_Type   $item    Block type data.
param: WP_REST_Request $request Full details about the request.

prepare_links( $block_type )   X-Ref
Prepares links for the request.

since: 5.5.0
return: array Links for the given block type.
param: WP_Block_Type $block_type Block type data.

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

since: 5.5.0
return: array Item schema data.

get_collection_params()   X-Ref
Retrieves the query params for collections.

since: 5.5.0
return: array Collection parameters.



Generated: Fri Apr 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1