Skip to content

Commit

Permalink
Add required query args
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed May 13, 2020
1 parent d0a8f06 commit cfd7708
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/edit-site/src/components/template-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,25 @@ export default function TemplateSwitcher( {
const { getCurrentTheme, getEntityRecords } = select( 'core' );
return {
currentTheme: getCurrentTheme(),
templates: getEntityRecords( 'postType', 'wp_template' )?.map(
( template ) => ( {
label: (
<TemplateLabel
template={ template }
homeId={ homeId }
/>
),
value: template.id,
slug: template.slug,
} )
),
templates: getEntityRecords( 'postType', 'wp_template', {
resolved: true,
} )?.map( ( template ) => ( {
label: (
<TemplateLabel
template={ template }
homeId={ homeId }
/>
),
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: <TemplateLabel template={ templatePart } />,
value: templatePart.id,
Expand Down

0 comments on commit cfd7708

Please sign in to comment.