Skip to content

Commit

Permalink
Site Editor: Prevent classic theme from accessing global style menu (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jan 30, 2024
1 parent 6804e72 commit 2719637
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/edit-site/src/components/sidebar-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useEffect } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
import { store as interfaceStore } from '@wordpress/interface';
import { store as blockEditorStore } from '@wordpress/block-editor';
import { store as coreStore } from '@wordpress/core-data';

/**
* Internal dependencies
Expand Down Expand Up @@ -41,13 +42,13 @@ export function SidebarComplementaryAreaFills() {
SIDEBAR_BLOCK,
SIDEBAR_TEMPLATE,
].includes( _sidebar );
const settings = select( editSiteStore ).getSettings();
return {
sidebar: _sidebar,
isEditorSidebarOpened: _isEditorSidebarOpened,
hasBlockSelection:
!! select( blockEditorStore ).getBlockSelectionStart(),
supportsGlobalStyles: ! settings?.supportsTemplatePartsMode,
supportsGlobalStyles:
select( coreStore ).getCurrentTheme()?.is_block_theme,
isEditingPage: select( editSiteStore ).isPage(),
};
}, [] );
Expand Down

0 comments on commit 2719637

Please sign in to comment.