WP_REST_Pattern_Directory_Controller
- Since
- 5.8.0
- Source
wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php:20
Controller which provides REST endpoint for block patterns.
Description
This simply proxies the endpoint at http://api.wordpress.org/patterns/1.0/. That isn't necessary for functionality, but is desired for privacy. It prevents api.wordpress.org from knowing the user's IP address.
Compatibility
- WordPress
- since 5.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 2
Every hook that fires from inside WP_REST_Pattern_Directory_Controller, in the order it appears in the class, grouped by the method that fires it.
Methods · 8
- __construct()Constructs the controller.
- register_routes()Registers the necessary REST API routes.
- get_items_permissions_check()Checks whether a given request has permission to view the local block pattern directory.
- get_items()Search and retrieve block patterns metadata
- prepare_item_for_response()Prepare a raw block pattern before it gets output in a REST API response.
- get_item_schema()Retrieves the block pattern's schema, conforming to JSON Schema.
- get_collection_params()Retrieves the search parameters for the block pattern's collection.
- get_transient_key()Include a hash of the query args, so that different requests are stored in separate caches.
Changelog
Introduced in 5.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.