Retrieves all block pattern categories.
Parameters
$request
WP_REST_Requestrequired- Full details about the request.
Source
public function get_items( $request ) {
$response = array();
$categories = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered();
foreach ( $categories as $category ) {
$prepared_category = $this->prepare_item_for_response( $category, $request );
$response[] = $this->prepare_response_for_collection( $prepared_category );
}
return rest_ensure_response( $response );
}
Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.