Hi Stephen!
Is it possible to show a list of people who have RSVPed for an event on the single event page?
I’d like to pull the attending user’s display name, and possibly their email address.
Thanks for your time!
Lorie
Lorie Travis
Hi Lorie,
Yes, but I’m assuming that you are selling ‘by series’? Otherwise you will need to get the occurrence ID of the particular date you are after (even if there is only one date!).
You can get a list of occurrence date(s), indexed by occurrence ID via: eo_get_the_occurrences()
– http://codex.wp-event-organiser.com/function-eo_get_the_occurrences_of.html
Then to get a list of bookings:
$bookings = eo_get_bookings( array(
'status'=>'confirmed',
'event_id' => get_the_ID(),
'occurrence_id' => $occurrence_id, //ignore this if selling by date
) );
You can display a list using the example on this page: http://codex.wp-event-organiser.com/function-eo_get_bookings.html
The code for getting and displaying the bookings can all go in event-meta-event-single.php
(or single-event.php
if your theme has it).
The example doesn’t include, but any user-provided data should be wrapped in esc_html()
e.g:
esc_html( eo_get_booking_meta( $booking->ID, 'bookee_display_name' ) )
rather than just
eo_get_booking_meta( $booking->ID, 'bookee_display_name' )
if it is to be printed to the page.
Stephen Harris
Hey Stephen
Thanks a lot, that works very well!
Is it possible to show the list of attendees between the event description and the booking form? I can’t seem to do that in single-event.php
nor event-meta-event-single.php
.
Thanks!
Oliver Flueckiger
@stephen
do you still maintain this plugin and offer support? I paid for support…
Oliver Flueckiger
Hi Oliver,
Sorry, I missed your initial reply. The plug-in by default will insert the form using the post_content
filter, so its actually part of the event description.
You can disable that with the following code:
add_filter( 'eventorganiser_pro_get_option_disable_automatic_form', '__return_true' );
added to the theme’s functions.php
. You’ll then need to render the booking form in the template, where you want the booking form to appear:
echo eo_get_booking_form( get_the_ID() );
Stephen Harris