the-events-calendar / ql-events

The Events Calendar binding to WPGraphQL
15 stars 7 forks source link

Additional sessions of event (recurring) can't be queried #16

Open craigwilcox opened 3 years ago

craigwilcox commented 3 years ago

Hi @kidunot89,

We've just noticed we can't get to additional sessions that are added to classes. They are called a series on the front end, but I believe the query is for a recurring instance. We need to be able to put all of these sessions on the calendar. Here's how it looks in The Events Calendar, and I believe the query for it is, I believe, here:

if ( class_exists( 'Tribe__Events__Pro__Recurrence__Event_Query' ) ) {
    $recurrence_query = new Tribe__Events__Pro__Recurrence__Event_Query();
    $parent_post      = get_post( $args['post_parent'] );
    if ( $parent_post instanceof WP_Post ) {
        $recurrence_query->set_parent_event( $parent_post );
        add_filter( 'posts_where', array( $recurrence_query, 'include_parent_event' ), 100 );
    }
}

image