WordPress at Your Fingertips
filter is not described

rest_prepare_block_pattern filter-hook . WP 5.8.0

Filters the REST API response for a pattern.

Usage

add_filter( 'rest_prepare_block_pattern', 'filter_function_name_1787', 10, 3 );
function filter_function_name_1787( $response, $raw_pattern, $request ){
	// filter...

	return $response;
}
$response(WP_REST_Response)
The response object.
$raw_pattern(object)
The unprepared pattern.
$request(WP_REST_Request)
The request object.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

WP_REST_Pattern_Directory_Controller::prepare_item_for_response()
rest_prepare_block_pattern
wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php 231
return apply_filters( 'rest_prepare_block_pattern', $response, $raw_pattern, $request );

Where in WP core the hook is used WordPress

Usage not found.