Skip to content

Commit

Permalink
Edit Post: Avoid unnecessary post-template ID lookup (#64431)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
3 people authored Aug 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4a8b166 commit 1e13913
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/edit-post/src/store/private-selectors.js
Original file line number Diff line number Diff line change
@@ -50,8 +50,11 @@ export const getEditedPostTemplateId = createRegistrySelector(
} else {
slugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;
}
return select( coreStore ).getDefaultTemplateId( {
slug: slugToCheck,
} );

if ( postType ) {
return select( coreStore ).getDefaultTemplateId( {
slug: slugToCheck,
} );
}
}
);

0 comments on commit 1e13913

Please sign in to comment.