Skip to content

Commit

Permalink
Explanatory comment
Browse files Browse the repository at this point in the history
I always struggle with this in my head, so some docs won't hurt.
  • Loading branch information
joedolson committed Oct 6, 2024
1 parent 421f099 commit 6941277
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mt-add-to-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ function mt_hide_remaining( $tickets_remaining ) {
// If hide remaining is enabled, set as hidden.
$remaining_limit = isset( $options['mt_hide_remaining_limit'] ) ? absint( $options['mt_hide_remaining_limit'] ) : 0;
$hide_remaining = ( isset( $options['mt_hide_remaining'] ) && 'true' === $options['mt_hide_remaining'] ) ? true : false;
// Hide this if 1) tickets remaining is hidden & limit is 0 or 2) tickets remaining is hidden and there are more tickets left than the limit.
$hidden_class = ( ( $hide_remaining && ! $remaining_limit ) || ( $hide_remaining && $tickets_remaining > $remaining_limit ) ) ? ' hiding' : '';

return $hidden_class;
Expand Down

0 comments on commit 6941277

Please sign in to comment.