Skip to content

Commit

Permalink
Prevent the post terms block from breaking on pages (#35957)
Browse files Browse the repository at this point in the history
* Post terms: Do not fetch taxonomies that do not exist for the post type
  • Loading branch information
carolinan authored Oct 29, 2021
1 parent 431b42e commit 7193ce6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-terms/use-post-terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function usePostTerms( { postId, postType, term } ) {
}
if ( ! termIds ) {
// Waiting for post terms to be fetched.
return { isLoading: true };
return { isLoading: term?.postTerms?.includes( postType ) };
}
if ( ! termIds.length ) {
return { isLoading: false };
Expand Down

0 comments on commit 7193ce6

Please sign in to comment.