diff --git a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js index 5738942e4779d9..e0201af3420970 100644 --- a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js +++ b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js @@ -11,6 +11,16 @@ export const TEMPLATES_POSTS = [ 'home', 'single' ]; export const TEMPLATES_STATUSES = [ 'publish', 'draft', 'auto-draft' ]; +export const TEMPLATES_NEW_OPTIONS = [ + 'front-page', + 'single-post', + 'page', + 'archive', + 'search', + '404', + 'index', +]; + export const MENU_ROOT = 'root'; export const MENU_CONTENT_CATEGORIES = 'content-categories'; export const MENU_CONTENT_PAGES = 'content-pages'; diff --git a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js index c20afcf5f0e8cd..c428472a051f2d 100644 --- a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +++ b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js @@ -20,7 +20,7 @@ import { Icon, plus } from '@wordpress/icons'; * Internal dependencies */ import getClosestAvailableTemplate from '../../../utils/get-closest-available-template'; -import { TEMPLATES_STATUSES } from './constants'; +import { TEMPLATES_NEW_OPTIONS, TEMPLATES_STATUSES } from './constants'; export default function NewTemplateDropdown() { const { defaultTemplateTypes, templates } = useSelect( ( select ) => { @@ -59,9 +59,15 @@ export default function NewTemplateDropdown() { const missingTemplates = filter( defaultTemplateTypes, - ( template ) => ! includes( existingTemplateSlugs, template.slug ) + ( template ) => + includes( TEMPLATES_NEW_OPTIONS, template.slug ) && + ! includes( existingTemplateSlugs, template.slug ) ); + if ( ! missingTemplates.length ) { + return null; + } + return (