Created
March 28, 2017 19:39
-
-
Save joshfeck/f706dd0c1d315289c7293b24a5fa9c02 to your computer and use it in GitHub Desktop.
Display remaining datetime registrations quantity on event listings where datetimes are shown
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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( | |
'FHEE__espresso_list_of_event_dates__datetime_html', | |
'my_add_total_spaces_display', | |
10, | |
2 | |
); | |
function my_add_total_spaces_display( $html, $datetime ) { | |
$html .= '<br><span class="space-remain">Total spaces remaining: '; | |
$html .= $datetime->total_tickets_available_at_this_datetime(); | |
$html .= '</span>'; | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add the above to a functions plugin or into your WordPress theme's functions.php file.
see also:
https://gist.github.com/joshfeck/d4ddcd2f2d25732d7a666123ab99a4e5