Skip to content

Non Administrator roles are no longer able to switch post templates (and therefore also cannot preview them) #68870

@fabiankaegy

Description

@fabiankaegy

In #60447 we added the ability for non administrators to preview the template as they are editing a post. Even long before this editors were always able to switch between which template should be selected for a post.

Today in trunk neither option is available to editor roles or below. They don't get the template selector and they don't get a template preview.

Looking into the source code the templateId never gets defined

const { templateId, isBlockTheme } = useSelect( ( select ) => {
const { getCurrentTemplateId, getEditorSettings } =
select( editorStore );
return {
templateId: getCurrentTemplateId(),
isBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme,
};
}, [] );

This is a major regression that we need to fix before the next WordPress release.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions