diff --git a/packages/edit-site/src/components/template-switcher/index.js b/packages/edit-site/src/components/template-switcher/index.js index e0fff1222befb8..a8fd6caa3a8572 100644 --- a/packages/edit-site/src/components/template-switcher/index.js +++ b/packages/edit-site/src/components/template-switcher/index.js @@ -71,21 +71,25 @@ export default function TemplateSwitcher( { const { getCurrentTheme, getEntityRecords } = select( 'core' ); return { currentTheme: getCurrentTheme(), - templates: getEntityRecords( 'postType', 'wp_template' )?.map( - ( template ) => ( { - label: ( - - ), - value: template.id, - slug: template.slug, - } ) - ), + templates: getEntityRecords( 'postType', 'wp_template', { + resolved: true, + } )?.map( ( template ) => ( { + label: ( + + ), + value: template.id, + slug: template.slug, + } ) ), templateParts: getEntityRecords( 'postType', - 'wp_template_part' + 'wp_template_part', + { + status: [ 'publish', 'auto-draft' ], + theme: getCurrentTheme()?.stylesheet, + } )?.map( ( templatePart ) => ( { label: , value: templatePart.id,