Changeset 54670 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
- Timestamp:
- 10/24/2022 02:14:25 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
r54210 r54670 296 296 if ( isset( $block_type->$extra_field ) ) { 297 297 $field = $block_type->$extra_field; 298 if ( in_array( $extra_field, $deprecated_fields, true ) && is_array( $field ) ) { 299 // Since the schema only allows strings or null (but no arrays), we return the first array item. 300 $field = ! empty( $field ) ? array_shift( $field ) : ''; 301 } 298 302 } elseif ( array_key_exists( 'default', $schema['properties'][ $extra_field ] ) ) { 299 303 $field = $schema['properties'][ $extra_field ]['default'];
Note: See TracChangeset
for help on using the changeset viewer.