Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Barry

    (@barryhughes-1)

    Yes, but it would have to be via a customization – though if you want to post a feature request on the issue tracker for a shortcode that takes care of this please feel free to do so 🙂

    https://github.com/barryhughes/event-rocket/issues

    You can find some (admittedly pretty light) docs about working with the RSVP system here – which should give a hint of what’s possible:

    https://github.com/barryhughes/event-rocket/wiki/RSVP-system

    Essentially, since RSVP data is stored per event, you would need to loop through upcoming events and test each one to see if the user is attending. For performance reasons (if you have a very large number of upcoming events) you might put some reasonable bounds on this, such as only retrieving upcoming events in the next 3 months or something of that nature.

    You could even use the event embed system to retrieve those events, if you want to make maximum use of Event Rocket 😉

    Untested, but this should give you an idea of how you might do things:

    $time_range = array(
        'from' => 'now',
        'to'   => '+3 months'
    );
    
    $events = event_embed()->obtain( $time_range );
    $output = '';
    
    foreach ( $events as $event ) {
        $attendance = eventrocket_rsvp()->attendance( $event->ID );
        if ( ! $attendance->is_user_attending( get_current_user_id() ) ) continue;
        else $output .= '<li>' . get_post_title( $event->ID ) . '</li>';
    }
    
    if ( empty( $output ) ) echo 'No confirmed attendances';
    else echo "<ul>$output</ul>";

    … Again, I’d stress I did not test this out – do double check for syntax etc before running!

    Thread Starter rachelexodus

    (@rachelexodus)

    Cool, thanks! Just added a feature request (https://github.com/barryhughes/event-rocket/issues/24) and will test out above code in the meantime. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show User Event RSVP's’ is closed to new replies.