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 <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
  • Loading branch information
3 people authored and getdave committed Aug 14, 2024
1 parent b59d797 commit 7d1877b
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
Expand Up @@ -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 7d1877b

Please sign in to comment.