[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Block_Directory_Controller class

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

Defines 1 class

WP_REST_Block_Directory_Controller:: (9 methods):
  __construct()
  register_routes()
  get_items_permissions_check()
  get_items()
  prepare_item_for_response()
  prepare_links()
  find_plugin_for_slug()
  get_item_schema()
  get_collection_params()


Class: WP_REST_Block_Directory_Controller  - X-Ref

Controller which provides REST endpoint for the blocks.

__construct()   X-Ref
Constructs the controller.


register_routes()   X-Ref
Registers the necessary REST API routes.


get_items_permissions_check( $request )   X-Ref
Checks whether a given request has permission to install and activate plugins.

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

get_items( $request )   X-Ref
Search and retrieve blocks metadata

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

prepare_item_for_response( $item, $request )   X-Ref
Parse block metadata for a block, and prepare it for an API response.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: array           $item    The plugin metadata.
param: WP_REST_Request $request Request object.
since: 5.5.0
since: 5.9.0 Renamed `$plugin` to `$item` to match parent class for PHP 8 named parameter support.

prepare_links( $plugin )   X-Ref
Generates a list of links to include in the response for the plugin.

return: array
param: array $plugin The plugin data from WordPress.org.
since: 5.5.0

find_plugin_for_slug( $slug )   X-Ref
Finds an installed plugin for the given slug.

return: string The plugin file found matching it.
param: string $slug The WordPress.org directory slug for a plugin.
since: 5.5.0

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

return: array Item schema data.
since: 5.5.0

get_collection_params()   X-Ref
Retrieves the search params for the blocks collection.

return: array Collection parameters.
since: 5.5.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1