Forked from joshfeck/content-espresso_event_attendees.php
Last active
December 16, 2025 20:48
-
-
Save Pebblo/1646a51897edf2c2f95c76237c000831 to your computer and use it in GitHub Desktop.
Example of a custom template for the [ESPRESSO_EVENT_ATTENDEES] shortcode. Event Espresso 4. You can add this template to your active WordPress theme.
This file contains hidden or 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 | |
| /** | |
| * Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode | |
| * | |
| * @package Event Espresso | |
| * @subpackage templates | |
| * @since 4.6.29 | |
| * @author Darren Ethier | |
| * | |
| * Template Args that are available in this template | |
| * @type EE_Attendee $contact | |
| * @type bool $show_gravatar whether to show gravatar or not. | |
| */ | |
| if ( $show_gravatar ) { | |
| $gravatar = get_avatar( $contact->email(), | |
| (int) apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32 ) | |
| ); | |
| } else { | |
| $gravatar = ''; | |
| } | |
| $most_recent_txn = $contact->get_most_recent_registration_for_event($event->get('EVT_ID'))->transaction()); | |
| $group_size = $most_recent_txn->count_related( 'Registration', [['STS_ID' => ['IN', ['RAP']]]]); | |
| // if group size is 1, ditch the quantity display | |
| $group_size = $group_size > 1 ? '(' . $group_size . ')' : ''; | |
| ?> | |
| <?php do_action( 'AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar ); ?> | |
| <li><?php echo $gravatar . ' ' . $contact->full_name() . ' ' . $group_size; ?></li> | |
| <?php do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment