Skip to content

Commit

Permalink
Don't show login banner if no tickets exist. (#1403)
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne authored Oct 23, 2024
1 parent a9519f0 commit 3052e3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function ticket_form_message() {
}

// Warn users that they will need to login to purchase a ticket
if ( ! is_user_logged_in() && ! $this->user_is_editing_ticket() ) {
if ( ! is_user_logged_in() && $camptix->has_tickets_available() && ! $this->user_is_editing_ticket() ) {
$camptix->notice( apply_filters(
'camptix_require_login_please_login_message',
sprintf(
Expand Down
9 changes: 9 additions & 0 deletions public_html/wp-content/plugins/camptix/camptix.php
Original file line number Diff line number Diff line change
Expand Up @@ -8586,6 +8586,15 @@ public function is_wordcamp_closed() {
$wordcamp = get_wordcamp_post();
return 'wcpt-closed' === $wordcamp->post_status;
}

/**
* Return whether there are available tickets.
*
* @return bool
*/
public function has_tickets_available() {
return $this->number_available_tickets() > 0;
}
}

// Initialize the $camptix global.
Expand Down

0 comments on commit 3052e3b

Please sign in to comment.