diff --git a/packages/block-editor/src/hooks/block-bindings.js b/packages/block-editor/src/hooks/block-bindings.js index 72ac01a099e6d..5e6a9486fcd66 100644 --- a/packages/block-editor/src/hooks/block-bindings.js +++ b/packages/block-editor/src/hooks/block-bindings.js @@ -33,6 +33,19 @@ export const BlockBindingsPanel = ( { metadata } ) => { return null; } + // Don't show the bindings connected to pattern overrides in the inspectors panel. + // TODO: Explore if this should be abstracted to let other sources decide. + const filteredBindings = { ...bindings }; + Object.keys( filteredBindings ).forEach( ( key ) => { + if ( filteredBindings[ key ].source === 'core/pattern-overrides' ) { + delete filteredBindings[ key ]; + } + } ); + + if ( Object.keys( filteredBindings ).length === 0 ) { + return null; + } + return ( { className="components-panel__block-bindings-panel" > - { Object.keys( bindings ).map( ( key ) => { + { Object.keys( filteredBindings ).map( ( key ) => { return ( { key } - { sources[ bindings[ key ].source ] - ? sources[ bindings[ key ].source ] - .label - : bindings[ key ].source } + { sources[ + filteredBindings[ key ].source + ] + ? sources[ + filteredBindings[ key ] + .source + ].label + : filteredBindings[ key ].source }