Skip to content

Commit

Permalink
Find the correct sectionRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 4, 2024
1 parent 3b550ba commit a116c3a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { mediaUpload } from '../../utils';
import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';
import { useGlobalStylesContext } from '../global-styles-provider';
import { TEMPLATE_POST_TYPE } from '../../store/constants';

const EMPTY_BLOCKS_LIST = [];
const EMPTY_OBJECT = {};
Expand Down Expand Up @@ -141,7 +142,10 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
: undefined;

function getSectionRootBlock() {
if ( renderingMode === 'template-locked' ) {
if (
renderingMode === 'template-locked' &&
postType !== TEMPLATE_POST_TYPE
) {
return getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';
}

Expand Down

0 comments on commit a116c3a

Please sign in to comment.