Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unhides the tickets button for past events.
/**
* Unhides the tickets button for past events.
*
* @param string $html
* @param WPT_Event $event
* @return string
*/
function unhide_old_tickets_url( $html, $event ) {
ob_start();
?><div class="<?php echo WPT_event::post_type_name; ?>_tickets"><?php
if ( WPT_Event::tickets_status_onsale == $event->tickets_status() ) {
echo $event->tickets_url_html();
echo $event->prices_html();
} else {
echo $event->tickets_status_html();
}
?></div><?php
return ob_get_clean();
}
add_filter( 'wpt/event/tickets/html', 'unhide_old_tickets_url', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.