Display public list of participants for an event

WordPress Event Management, Calendars & Registration Forums Request A Feature Display public list of participants for an event

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 7 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22622

    Hi, I am using Event Organisor Pro. Is there a possibility to display a public list of participants (name/city) for a certain event? I am evaluating Event Organisor to be used for Race registration. See this example from another registration website: http://www.inschrijven.nl/dln/meidoornloop.html

    Jos den Hollander
    #22647

    Hi Jos,

    This is possible, by using this function: http://codex.wp-event-organiser.com/function-eo_get_bookings.html.

    However, if it’s a recurring event and you’re selling by date, then you will need to specify a the occurrence ID to retrieve the bookings for.

    You can retrieve any data stored against the booking (collected by the booking form), via:

    eo_get_booking_meta( $booking_id, 'meta_123' );
    

    where 123 is the ID of a booking form element.

    Stephen Harris
    #22659

    Thx Steven, as I am not really a programmer I was wondering how to embed the eo_get_bookings function into my WordPress html page, assuming I am using 129 as event_id and 0 as occurence_id.

    http://www.zeelandrunning.nl/?page_id=1110

    Jos den Hollander
    #22663

    Hi Jos,

    The only way you could do that is to create a shortcode:

    <?php
    add_shortcode( 'myshortcode', function() {
         $bookings = eo_get_bookings( array(
              'status'=>'confirmed',
              'event_id' => get_the_ID(),
              'occurrence_id' => 0,
        ) );
    
       if( $bookings ){
           $html = '<ul>';
           foreach( $bookings as $booking ){
             $html .= sprintf(
                 '<li> %1$s booked %2$s places for %3$s </li>',
                 eo_get_booking_meta( $booking->ID, 'bookee_display_name' ),
                 eo_get_booking_meta( $booking->ID, 'ticket_quantity' ),
                 get_the_title( eo_get_booking_meta( $booking->ID, 'event_id' ) )
             );
           }
           $html .= '</ul>';
        }
        return $html;
     } );
    

    and then you can use [myshortcode] in the event editor.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.