| [ Index ] | PHP Cross Reference of WordPress Trunk (Updated Daily) | 
[Source view] [Print] [Project Stats]
REST API: WP_REST_Block_Patterns_Controller class
| File Size: | 304 lines (9 kb) | 
| Included or required: | 0 times | 
| Referenced: | 0 times | 
| Includes or requires: | 0 files | 
WP_REST_Block_Patterns_Controller:: (7 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  migrate_pattern_categories()
  prepare_item_for_response()
  get_item_schema()
Class: WP_REST_Block_Patterns_Controller - X-Ref
Core class used to access block patterns via the REST API.| __construct() X-Ref | 
| Constructs the controller. | 
| register_routes() X-Ref | 
| Registers the routes for the objects of the controller. | 
| get_items_permissions_check( $request ) X-Ref | 
| Checks whether a given request has permission to read block patterns. 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 all block patterns. 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. | 
| migrate_pattern_categories( $pattern ) X-Ref | 
| Migrates old core pattern categories to the new categories. Core pattern categories are revamped. Migration is needed to ensure backwards compatibility. param: array $pattern Raw pattern as registered, before applying any changes. return: array Migrated pattern. | 
| prepare_item_for_response( $item, $request ) X-Ref | 
| Prepare a raw block pattern before it gets output in a REST API response. param: array $item Raw pattern as registered, before any changes. param: WP_REST_Request $request Request object. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. | 
| get_item_schema() X-Ref | 
| Retrieves the block pattern schema, conforming to JSON Schema. return: array Item schema data. | 
| Generated : Fri Oct 31 08:20:06 2025 | Cross-referenced by PHPXref |