diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php
index 3388078d05..926bcec4b2 100644
|
a
|
b
|
class WP_REST_Block_Renderer_Controller extends WP_REST_Controller { |
| 54 | 54 | 'description' => __( 'Attributes for the block' ), |
| 55 | 55 | 'type' => 'object', |
| 56 | 56 | 'default' => array(), |
| | 57 | 'sanitize_callback' => static function ( $value, $request ) { |
| | 58 | $block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] ); |
| | 59 | |
| | 60 | if ( ! $block ) { |
| | 61 | // This will get rejected in ::get_item(). |
| | 62 | return true; |
| | 63 | } |
| | 64 | |
| | 65 | $schema = array( |
| | 66 | 'type' => 'object', |
| | 67 | 'properties' => $block->get_attributes(), |
| | 68 | 'additionalProperties' => false, |
| | 69 | ); |
| | 70 | |
| | 71 | return rest_sanitize_value_from_schema( $value, $schema ); |
| | 72 | }, |
| 57 | 73 | 'validate_callback' => static function ( $value, $request ) { |
| 58 | 74 | $block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] ); |
| 59 | 75 | |