Skip to content

Commit b667034

Browse files
committed
Remove values property, reverting back to attributes being at root of content attribute
1 parent eb5bc0f commit b667034

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/compat/wordpress-6.5/block-bindings/pattern-overrides.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function gutenberg_block_bindings_pattern_overrides_callback( $source_attrs, $bl
1919
return null;
2020
}
2121
$metadata_name = $block_instance->attributes['metadata']['name'];
22-
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $metadata_name, 'values', $attribute_name ), null );
22+
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $metadata_name, $attribute_name ), null );
2323
}
2424

2525
/**

packages/block-library/src/block/edit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function applyInitialContentValuesToInnerBlocks(
119119
defaultValues[ metadataName ][ attributeKey ] =
120120
block.attributes[ attributeKey ];
121121

122-
const contentValues = content[ metadataName ]?.values;
122+
const contentValues = content[ metadataName ];
123123
if ( contentValues?.[ attributeKey ] !== undefined ) {
124124
newAttributes[ attributeKey ] = contentValues[ attributeKey ];
125125
}
@@ -161,10 +161,10 @@ function getContentValuesFromInnerBlocks( blocks, defaultValues ) {
161161
defaultValues[ metadataName ][ attributeKey ]
162162
)
163163
) {
164-
content[ metadataName ] ??= { values: {} };
164+
content[ metadataName ] ??= {};
165165
// TODO: We need a way to represent `undefined` in the serialized overrides.
166166
// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
167-
content[ metadataName ].values[ attributeKey ] =
167+
content[ metadataName ][ attributeKey ] =
168168
block.attributes[ attributeKey ] === undefined
169169
? // TODO: We use an empty string to represent undefined for now until
170170
// we support a richer format for overrides and the block binding API.

0 commit comments

Comments
 (0)