From eef62cbc3132bef457d4111afa27c1830e3a000d Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Wed, 7 Feb 2024 17:32:02 +0100 Subject: [PATCH] Set `lockEditing` to false in pattern overrides --- .../block-editor/src/hooks/use-bindings-attributes.js | 2 +- packages/editor/src/bindings/index.js | 2 ++ packages/editor/src/bindings/pattern-overrides.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 packages/editor/src/bindings/pattern-overrides.js diff --git a/packages/block-editor/src/hooks/use-bindings-attributes.js b/packages/block-editor/src/hooks/use-bindings-attributes.js index c6c847cbddcd1..48700e899c680 100644 --- a/packages/block-editor/src/hooks/use-bindings-attributes.js +++ b/packages/block-editor/src/hooks/use-bindings-attributes.js @@ -47,7 +47,7 @@ const createEditFunctionWithBindingsAttribute = () => settings.source ); - if ( source ) { + if ( source && source.useSource ) { // Second argument (`updateMetaValue`) will be used to update the value in the future. const { placeholder, diff --git a/packages/editor/src/bindings/index.js b/packages/editor/src/bindings/index.js index 8a883e8904a71..ff0516902e321 100644 --- a/packages/editor/src/bindings/index.js +++ b/packages/editor/src/bindings/index.js @@ -7,7 +7,9 @@ import { dispatch } from '@wordpress/data'; * Internal dependencies */ import { unlock } from '../lock-unlock'; +import patternOverrides from './pattern-overrides'; import postMeta from './post-meta'; const { registerBlockBindingsSource } = unlock( dispatch( blockEditorStore ) ); +registerBlockBindingsSource( patternOverrides ); registerBlockBindingsSource( postMeta ); diff --git a/packages/editor/src/bindings/pattern-overrides.js b/packages/editor/src/bindings/pattern-overrides.js new file mode 100644 index 0000000000000..a2b2107b5e451 --- /dev/null +++ b/packages/editor/src/bindings/pattern-overrides.js @@ -0,0 +1,11 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +export default { + name: 'core/pattern-overrides', + label: __( 'Pattern Overrides' ), + useSource: null, + lockAttributesEditing: false, +};