Changeset 63524 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
- Timestamp:
- 09/08/2026 06:04:10 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
r59970 r63524 331 331 332 332 if ( rest_is_field_included( 'styles', $fields ) ) { 333 $styles = $this->style_registry->get_registered_styles_for_block( $block_type->name ); 334 $styles = array_values( $styles ); 335 $data['styles'] = wp_parse_args( $styles, $data['styles'] ); 333 $styles = $this->style_registry->get_registered_styles_for_block( $block_type->name ); 334 $styles = array_values( $styles ); 335 336 /* 337 * The loop above assigns this key from rest_sanitize_value_from_schema(), whose 338 * return is documented as `mixed|WP_Error`, so what the styles came back as has 339 * to be restated here. A WP_Error is why the value is checked rather than cast. 340 */ 341 /** 342 * @var array<string, mixed>[] $block_styles 343 * @phpstan-var list<Block_Style_Properties> $block_styles 344 */ 345 $block_styles = isset( $data['styles'] ) && is_array( $data['styles'] ) ? $data['styles'] : array(); 346 347 $data['styles'] = array_merge( $block_styles, $styles ); 336 348 $data['styles'] = array_filter( $data['styles'] ); 337 349 }
Note:
See TracChangeset
for help on using the changeset viewer.