Programmatically tell if an event is part of a series of recurring events

Home Forums Calendar Products Events Calendar PRO Programmatically tell if an event is part of a series of recurring events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1021492
    substance
    Participant

    Hi,

    For various reasons, I need to be able to tell if an event (either single or listed) is part of a set of recurring events, either via some conditional tag like tribe_is_recurrence or similar. Is this possible?

    Additionally, is there a way to find the post ID of the “master” event of a recurrence? I’ve noticed that when viewing the Edit admin of All Events, There’s a quick link to “Edit All” that seems to have that ID. How can I access that ID on the front end?

    Thanks!

    #1021623
    Nico
    Member

    Hi @substance,

    Thanks for reaching out on this, I’ll try to help you here!

    To check if an event is recurring you can use the function tribe_is_recurring_event, you can pass the event id to the function otherwise it will try to use the global current event ID (present in loops). And to get the ‘main event’ you can check the post_parent propoerty of the post(event) object.

    Please let me know if there’s anything else I can help you with,
    Best,
    Nico

    #1022226
    substance
    Participant

    This is exactly what I needed, thanks!

    #1022262
    Nico
    Member

    Hey Substance,

    Stocked to hear! Glad to be of service 🙂

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Programmatically tell if an event is part of a series of recurring events’ is closed to new replies.