rest_prepare_block_type filter-hook . WP 5.5.0
Filters a block type returned from the REST API.
Allows modification of the block type data right before it is returned.
Usage
add_filter( 'rest_prepare_block_type', 'filter_function_name_2476', 10, 3 ); function filter_function_name_2476( $response, $block_type, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $block_type(WP_Block_Type)
- The original block type object.
- $request(WP_REST_Request)
- Request used to generate the response.
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
rest_prepare_block_type
wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php 317
return apply_filters( 'rest_prepare_block_type', $response, $block_type, $request );