Skip to content

Commit

Permalink
Don't use getBlockAttributes inside getValue
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed May 21, 2024
1 parent aa0ad3e commit 0e91129
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/editor/src/bindings/pattern-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ export default {
name: 'core/pattern-overrides',
label: _x( 'Pattern Overrides', 'block bindings source' ),
getValue( { select, clientId, attributeName } ) {
const { getBlockAttributes, getBlockParentsByBlockName } =
const { getBlock, getBlockParentsByBlockName } =
select( blockEditorStore );
const currentBlockAttributes = getBlockAttributes( clientId );
const { attributes: currentBlockAttributes } = getBlock( clientId );
const [ patternClientId ] = getBlockParentsByBlockName(
clientId,
'core/block',
true
);

const overridableValue =
getBlockAttributes( patternClientId )?.[ CONTENT ]?.[
getBlock( patternClientId )?.attributes?.[ CONTENT ]?.[
currentBlockAttributes?.metadata?.name
]?.[ attributeName ];

Expand Down

0 comments on commit 0e91129

Please sign in to comment.