Changeset 57578 for trunk/src/wp-includes/blocks/block.php
- Timestamp:
- 02/09/2024 06:20:12 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/block.php
r57377 r57578 47 47 $content = $wp_embed->autoembed( $content ); 48 48 49 $has_pattern_overrides = isset( $attributes['overrides'] ); 49 // Back compat, the content attribute was previously named overrides and 50 // had a slightly different format. For blocks that have not been migrated, 51 // also convert the format here so that the provided `pattern/overrides` 52 // context is correct. 53 if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) { 54 $migrated_content = array(); 55 foreach ( $attributes['overrides'] as $id => $values ) { 56 $migrated_content[ $id ] = array( 57 'values' => $values, 58 ); 59 } 60 $attributes['content'] = $migrated_content; 61 } 62 $has_pattern_overrides = isset( $attributes['content'] ); 50 63 51 64 /** … … 56 69 if ( $has_pattern_overrides ) { 57 70 $filter_block_context = static function ( $context ) use ( $attributes ) { 58 $context['pattern/overrides'] = $attributes[' overrides'];71 $context['pattern/overrides'] = $attributes['content']; 59 72 return $context; 60 73 };
Note: See TracChangeset
for help on using the changeset viewer.