Tribe__Tickets__Tickets::show_tickets_unavailable_message()
If appropriate, display a “tickets unavailable” message.
Source
File: src/Tribe/Tickets.php
public function show_tickets_unavailable_message() {
$post_id = (int) get_the_ID();
// So long as at least one ticket provider has tickets available, do not show an unavailability message
if ( in_array( $post_id, self::$posts_with_available_tickets ) ) {
return;
}
// Bail if no ticket providers reported that all their tickets for the event were unavailable
if ( empty( self::$currently_unavailable_tickets[ $post_id ] ) ) {
return;
}
// Prepare the message
$message = '<div class="tickets-unavailable">'
. $this->get_tickets_unavailable_message( self::$currently_unavailable_tickets[ $post_id ] )
. '</div>';
/**
* Sets the tickets unavailable message.
*
* @param string $message
* @param int $post_id
* @param array $unavailable_event_tickets
*/
echo apply_filters( 'tribe_tickets_unavailable_message', $message, $post_id, self::$currently_unavailable_tickets[ $post_id ] );
// Remove the record of unavailable tickets to avoid duplicate messages being rendered for the same event
unset( self::$currently_unavailable_tickets[ $post_id ] );
}