cliffordp
9/12/2016 - 4:05 PM

for https://theeventscalendar.com/support/forums/topic/gravatar-showing-instead-of-attendee-name/

<?php
/**
 * Renders the attendee list for an event
 *
 * @version 4.1
 *
 * from https://gist.github.com/cliffordp/718af5da51046f60b92372d01804f433
 * Screenshot of example output: https://cl.ly/093h1G2A1m3H
 * put this file here: /wp-content/themes/YOUR-CHILD-THEME/tribe-events/attendees-list.php
 * @link https://theeventscalendar.com/knowledgebase/themers-guide/#tickets-plus
 *
 */
?>
<div class='tribe-attendees-list-container'>
	<h2 class="tribe-attendees-list-title"><?php esc_html_e( 'Who\'s Attending', 'event-tickets-plus' ) ?></h2>
	<p><?php echo esc_html( sprintf( _n( 'One person is attending %2$s', '%d people are attending %s', $attendees_total, 'event-tickets-plus' ), $attendees_total, get_the_title( $event->ID ) ) ); ?></p>

	<ul class='tribe-attendees-list'>
	<?php foreach ( $attendees_list as $attendee_id => $avatar_html ) {
		
		// include RSVP's Name
		
		// reset
		$name = '';
		
		// $attendee_id is the Post ID for each tribe_rsvp_attendees post type post (only works for RSVP type tickets, not WooCommerce, EDD, etc)
		// https://developer.wordpress.org/reference/functions/get_post_meta/
		$name = get_post_meta( $attendee_id, '_tribe_rsvp_full_name', true );
		$name = trim( $name );
	?>
		<li class='tribe-attendees-list-item'>
		<?php echo $avatar_html;
			if ( ! empty( $name ) ) {
				printf( ' <span class="tribe-custom-attendee-name">%s</span>', $name );
			}
		?></li>
	<?php } ?>
	</ul>
</div>