rest_prepare_block_type

rest_prepare_block_type

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.8.2

apply_filters('rest_prepare_block_type') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php line 261
     
    		// Don't prepare the response body for HEAD requests.
    		if ( $request->is_method( 'HEAD' ) ) {
    			/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php */
    			return apply_filters( 'rest_prepare_block_type', new WP_REST_Response( array() ), $block_type, $request );
    		}
    
    		$fields = $this->get_fields_for_response( $request );
    		$data   = array();
    
    		if ( rest_is_field_included( 'attributes', $fields ) ) {
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php line 360
    		 * @param WP_REST_Response $response   The response object.
    		 * @param WP_Block_Type    $block_type The original block type object.
    		 * @param WP_REST_Request  $request    Request used to generate the response.
    		 */
    		return apply_filters( 'rest_prepare_block_type', $response, $block_type, $request );
    	}
    
    	/**
    	 * Prepares links for the request.
    	 *
    	 * @since 5.5.0
    

See this hook used in plugins: