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 12, 2020
1 parent add7034 commit f6123d7
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 f6123d7

Please sign in to comment.