hi,
you can try to modify template file under events-manager/templates/placeholders/attendeeslist.php
to use templates: http://wp-events-plugin.com/documentation/using-template-files/
eg. wp-content/themes/Your Theme/plugins/events-manager/placeholders/attendeeslist.php
Hi Gelo!
Thanks, I found that one pretty soon.
I was wondering if someone could give me some pointers on how to retrieve the role of each attendee.
Thanks! I tried that before, that resulted in it just displaying the role of the signed in user. But I’ll experiment some more with it.
I guess this bit should help:
<?php $user_info = get_userdata(1);
echo ‘Username: ‘ . $user_info->user_login . “\n”;
echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”;
echo ‘User ID: ‘ . $user_info->ID . “\n”;
?>
The function get_userdata(1); should be adjusted so it looks at the users that signed up. Maybe execute this per attendee.
this might be an old article but should be something like this – http://stackoverflow.com/questions/1458362/how-to-get-the-currently-logged-in-users-role-in-wordpress
you can use $EM_Booking->get_person()->ID as the user id
Thanks for the help!
I tried working with this. I could not get it to work so I tried if I could show the wordpress data using the link caimin posted.
I pasted the code from the codex page
$user_info = get_userdata(1);
echo 'Username: ' . $user_info->user_login . "\n";
echo 'User ID: ' . $user_info->ID . "\n";
Its not displaying anything, even tho its unmodified, straight out of the codex page. So I’m not sure whats going wrong at the moment.
When I used the Events Manager attribute
echo '<li>' . $EM_Booking->get_person()->id;
it did work. So is Events Manger blocking WP codes?
I’ve got an example here: http://www.airsoftclubnederland.nl/evenementen/bunker-hill/
You can see it, not working by the title: Wie gaan er allemaal?
Allright! Had some more time to tinker with this. I got it to work!
$aanmelding = $EM_Booking->get_person()->ID;
$user = new WP_User( $aanmelding );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role )
echo '
<li>'. $EM_Booking->get_person()->get_name() .' - ' . $role .' - Aantal personen : ' . $EM_Booking->get_spaces() . '</li>
';
}
I’d love to tweak it so its not showing the role id but the role name. Havent figured that out yet, after a few hours of googling and trying stuff out.