Created
October 17, 2017 19:27
-
-
Save slimndap/97350a60b5a37e225686ac279e25e412 to your computer and use it in GitHub Desktop.
Unhides the tickets button for past events.
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
/** | |
* 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