Skip to content

Commit

Permalink
Early exit if no terms match
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMKindred committed Sep 25, 2023
1 parent 62dd68f commit 164ff43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wp-content/themes/core/blocks/tribe/terms/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

echo '<div ' . get_block_wrapper_attributes() . '>';

if ( 0 === count( $terms ) ) {
echo '<!-- Terms block: No terms to list. -->';
echo '</div>';

return;
}

if ( count( $terms ) > 1 ) {
echo '<ul class="wp-block-tribe-terms__list">';
}
Expand Down

0 comments on commit 164ff43

Please sign in to comment.