[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Synced patterns REST API: WP_REST_Blocks_Controller class

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

Defines 1 class

WP_REST_Blocks_Controller:: (3 methods):
  check_read_permission()
  filter_response_by_context()
  get_item_schema()


Class: WP_REST_Blocks_Controller  - X-Ref

Controller which provides a REST endpoint for the editor to read, create,
edit, and delete synced patterns (formerly called reusable blocks).
Patterns are stored as posts with the wp_block post type.

check_read_permission( $post )   X-Ref
Checks if a pattern can be read.

return: bool Whether the pattern can be read.
param: WP_Post $post Post object that backs the block.

filter_response_by_context( $data, $context )   X-Ref
Filters a response based on the context defined in the schema.

return: array Filtered response.
param: array  $data    Response data to filter.
param: string $context Context defined in the schema.

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

return: array Item schema data.



Generated : Sat Nov 23 08:20:01 2024 Cross-referenced by PHPXref