Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Last active May 1, 2017 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasguseo/25e72db4806b9400c2f76dbad506cad7 to your computer and use it in GitHub Desktop.
Save andrasguseo/25e72db4806b9400c2f76dbad506cad7 to your computer and use it in GitHub Desktop.
Print message if no tickets are available
<?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