Get occurrence ID

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

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

    Hello,

    Is there a way to loop through the occurrence_id for each occurrence of the event page I’m on?

    I’d like to list the confirmed bookings for each individual occurrence of my event, but I’m having trouble figuring out how to pull the occurrence_ids to plug in to eo_get_bookings().

    Thanks!

    Natalie Parisi
    #9778

    Yes, eo_get_the_occurrences_of() returns an array indexed by the occurrence IDs. (Each value in that array is also an array of DateTimes indexed by ‘start’ and ‘end’ respectively).

    You can get all the occurence IDs for an event:

    $occurrences = eo_get_the_occurrences_of( get_the_ID() );
    $occurence_ids = array_keys( $occurrences );

    (In 2.7 I’ll add a function which will make accessing IDs a bit cleaner.)

    Stephen Harris
    #9790

    Perfect, just what I needed! Figuring that out was a bit outside of my technical abilities.

    Thanks so much for the quick and helpful reply! Really loving this plug-in and its flexibility, as well as the excellent support.

    Natalie Parisi
    #9794

    You’re welcome :).

    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.