Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created March 28, 2017 19:39
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 joshfeck/f706dd0c1d315289c7293b24a5fa9c02 to your computer and use it in GitHub Desktop.
Save joshfeck/f706dd0c1d315289c7293b24a5fa9c02 to your computer and use it in GitHub Desktop.
Display remaining datetime registrations quantity on event listings where datetimes are shown
<?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;
}
@joshfeck
Copy link
Author

joshfeck commented May 2, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment