Skip to content

Commit

Permalink
Most Used Terms: Avoid 403 error for non-administrators (#33569)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jul 20, 2021
1 parent 5c5ff4d commit bf32b53
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DEFAULT_QUERY = {
order: 'desc',
hide_empty: true,
_fields: 'id,name,count',
context: 'view',
};

export default function MostUsedTerms( { onSelect, taxonomy } ) {
Expand All @@ -33,7 +34,7 @@ export default function MostUsedTerms( { onSelect, taxonomy } ) {
);
return {
_terms: mostUsedTerms,
showTerms: mostUsedTerms?.length >= MAX_MOST_USED_TERMS,
showTerms: mostUsedTerms?.length === MAX_MOST_USED_TERMS,
};
}, [] );

Expand Down

0 comments on commit bf32b53

Please sign in to comment.