Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor: Template parts not loading when block theme has parent directory #27633

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Query by theme name instead of theme slug
  • Loading branch information
jeyip committed Dec 18, 2020
commit a7d8bf02eb19f34b31c5b42598afacbe84a5bad9
Original file line number Diff line number Diff line change
@@ -26,14 +26,13 @@ export default function useTemplatePartPost( postId, slug, theme ) {
const currentTheme = select( 'core' ).getCurrentTheme()
?.stylesheet;
const cleanedSlug = cleanForSlug( slug );
const themeSlug = currentTheme?.replace( '/', '-' );
const posts = select( 'core' ).getEntityRecords(
'postType',
'wp_template_part',
{
status: [ 'publish', 'auto-draft' ],
slug: cleanedSlug,
theme: themeSlug,
theme: currentTheme,
}
);