Skip to content

Commit

Permalink
Update pattern overrides block bindings callback to use block metadat…
Browse files Browse the repository at this point in the history
…a name
  • Loading branch information
talldan authored and youknowriad committed Mar 4, 2024
1 parent de652d9 commit dde24e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wp-includes/block-bindings/pattern-overrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* @return mixed The value computed for the source.
*/
function _block_bindings_pattern_overrides_get_value( array $source_args, $block_instance, string $attribute_name ) {
if ( empty( $block_instance->attributes['metadata']['id'] ) ) {
if ( empty( $block_instance->attributes['metadata']['name'] ) ) {
return null;
}
$block_id = $block_instance->attributes['metadata']['id'];
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $block_id, 'values', $attribute_name ), null );
$metadata_name = $block_instance->attributes['metadata']['name'];
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $metadata_name, $attribute_name ), null );
}

/**
Expand Down

0 comments on commit dde24e1

Please sign in to comment.