Last active
May 1, 2017 22:24
-
-
Save andrasguseo/25e72db4806b9400c2f76dbad506cad7 to your computer and use it in GitHub Desktop.
Print message if no tickets are available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* If there are no tickets available for a future event, or the event is in the past, | |
* Then a message will be shown to the users on the single event page. | |
* | |
* For The Events Calendar and Event Tickets plugins by Modern Tribe | |
* Author: Andras Guseo | |
* Last updated: May 1, 2017 | |
*/ | |
add_action( 'tribe_events_single_event_after_the_meta', 'no_tix_message' ); | |
function no_tix_message() { | |
if ( tribe_events_count_available_tickets() <= 0 || tribe_is_past_event() ) { | |
echo "Sorry, there are no more tickets for this event."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment