Skip to content
Merged
Changes from all commits
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
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 @@ -12,7 +12,7 @@ export default function usePostTerms( { postId, term } ) {
return useSelect(
( select ) => {
const visible = term?.visibility?.publicly_queryable;
if ( ! visible ) {
if ( ! visible || ! postId ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case we were using this hook without passing the id?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In templates like single, etc..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. Sorry, I thought I mentioned it in the description.

return {
postTerms: EMPTY_ARRAY,
isLoading: false,
Expand Down
Loading