diff --git a/packages/edit-post/src/components/header/template-title/edit-template-title.js b/packages/edit-post/src/components/header/template-title/edit-template-title.js index 2865e674b341fd..8f2ccf8ef56fbb 100644 --- a/packages/edit-post/src/components/header/template-title/edit-template-title.js +++ b/packages/edit-post/src/components/header/template-title/edit-template-title.js @@ -29,7 +29,8 @@ export default function EditTemplateTitle() { const { getEditorSettings } = useSelect( editorStore ); const { updateEditorSettings } = useDispatch( editorStore ); - if ( template.has_theme_file ) { + // Only user-created and non-default templates can change the name. + if ( ! template.is_custom || template.has_theme_file ) { return null; } diff --git a/packages/edit-site/src/components/template-details/index.js b/packages/edit-site/src/components/template-details/index.js index 5963040b7ef5bd..71bbb41be2860c 100644 --- a/packages/edit-site/src/components/template-details/index.js +++ b/packages/edit-site/src/components/template-details/index.js @@ -50,6 +50,9 @@ export default function TemplateDetails( { template, onClose } ) { postId: undefined, } ); + // Only user-created and non-default templates can change the name. + const canEditTitle = template.is_custom && ! template.has_theme_file; + if ( ! template ) { return null; } @@ -62,7 +65,7 @@ export default function TemplateDetails( { template, onClose } ) { return (
- { template.is_custom ? ( + { canEditTitle ? ( ) : (