diff --git a/packages/editor/src/components/block-settings-menu/content-only-settings-menu.js b/packages/editor/src/components/block-settings-menu/content-only-settings-menu.js index fcf7adfa77635c..2b69c59bb8b127 100644 --- a/packages/editor/src/components/block-settings-menu/content-only-settings-menu.js +++ b/packages/editor/src/components/block-settings-menu/content-only-settings-menu.js @@ -46,17 +46,25 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) { getBlockAttributes( patternParent ).ref ); } else { - const { getCurrentTemplateId } = select( editorStore ); - const templateId = getCurrentTemplateId(); - const { getContentLockingParent } = unlock( - select( blockEditorStore ) - ); - if ( ! getContentLockingParent( clientId ) && templateId ) { - record = select( coreStore ).getEntityRecord( - 'postType', - 'wp_template', - templateId + const postContentParent = getBlockParentsByBlockName( + clientId, + 'core/post-content', + true + )[ 0 ]; + + if ( ! postContentParent ) { + const { getCurrentTemplateId } = select( editorStore ); + const templateId = getCurrentTemplateId(); + const { getContentLockingParent } = unlock( + select( blockEditorStore ) ); + if ( ! getContentLockingParent( clientId ) && templateId ) { + record = select( coreStore ).getEntityRecord( + 'postType', + 'wp_template', + templateId + ); + } } } const _canEditTemplates = select( coreStore ).canUser( 'create', {