diff --git a/packages/block-editor/src/components/global-styles/image-settings-panel.js b/packages/block-editor/src/components/global-styles/image-settings-panel.js index 296d7b87d07379..0ae46605dc2d20 100644 --- a/packages/block-editor/src/components/global-styles/image-settings-panel.js +++ b/packages/block-editor/src/components/global-styles/image-settings-panel.js @@ -8,14 +8,14 @@ import { } from '@wordpress/components'; import { __, _x } from '@wordpress/i18n'; -export function useHasImageSettingsPanel( name, settings, userSettings ) { - // Note: If lightbox userSettings exists, that means - // they were defined via the Global Styles UI and - // will NOT be a boolean value or contain the `allowEditing` - // property, so we should show the settings panel in those cases. +export function useHasImageSettingsPanel( name, value, inheritedValue ) { + // Note: If lightbox `value` exists, that means it was + // defined via the the Global Styles UI and will NOT + // be a boolean value or contain the `allowEditing` property, + // so we should show the settings panel in those cases. return ( - ( name === 'core/image' && settings?.lightbox?.allowEditing ) || - !! userSettings?.lightbox + ( name === 'core/image' && inheritedValue?.lightbox?.allowEditing ) || + !! value?.lightbox ); } diff --git a/packages/edit-site/src/components/global-styles/screen-block.js b/packages/edit-site/src/components/global-styles/screen-block.js index ce8f0ee71df252..db60f992c41d5d 100644 --- a/packages/edit-site/src/components/global-styles/screen-block.js +++ b/packages/edit-site/src/components/global-styles/screen-block.js @@ -118,8 +118,8 @@ function ScreenBlock( { name, variation } ) { const hasFiltersPanel = useHasFiltersPanel( settings ); const hasImageSettingsPanel = useHasImageSettingsPanel( name, - settings, - userSettings + userSettings, + settings ); const hasVariationsPanel = !! blockVariations?.length && ! variation; const { canEditCSS } = useSelect( ( select ) => {