Skip to content

Commit

Permalink
Editor: Remove edit template menu item from block settings menu in bl…
Browse files Browse the repository at this point in the history
…ocks outside template. (#65560)
  • Loading branch information
ellatrix committed Oct 22, 2024
1 parent d685646 commit 2effcf0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
} else {
const { getCurrentTemplateId } = select( editorStore );
const templateId = getCurrentTemplateId();
const { getContentLockingParent } = unlock(
const { getContentLockingParent, getRenderingMode } = unlock(
select( blockEditorStore )
);
if ( ! getContentLockingParent( clientId ) && templateId ) {
if (
getRenderingMode() === 'template-locked' &&
! getContentLockingParent( clientId ) &&
templateId
) {
record = select( coreStore ).getEntityRecord(
'postType',
'wp_template',
Expand Down

0 comments on commit 2effcf0

Please sign in to comment.