Unable to query all events

Home Forums Calendar Products Events Calendar PRO Unable to query all events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1120153
    Brian Hogg
    Participant

    Hello!

    I’m using Tribe__Events__Query::getEvents and I’m not able to query all events properly. Even if I pass in posts_per_page => 10000, it’s only returning 225 events. When I use a meta query to search for events occurring after the last event returned, I get the rest of the 122 events:

    $query = Tribe__Events__Query::getEvents( array( 'posts_per_page' => 10000, 'post_status' => 'publish', 'meta_query' => array( array(
    array(
    'key' => '_EventStartDate',
    'value' => array( date( 'Y-m-d', $start_date - 86400 ), date( 'Y-m-d', $end_date + 86400 ) ),
    'compare' => 'BETWEEN',
    'type' => 'DATETIME'
    )
    ) ) );

    Is there some extra filter or other param that’s blocking all events from being fetched somewhere?

    Thanks!
    Brian

    #1120168
    Cliff
    Member

    Hi Brian. Thanks for your question.

    Please reference Using tribe_get_events() and let me know if you have any follow-up questions.

    #1120279
    Brian Hogg
    Participant

    Hi Cliff,

    Thanks for the quick reply!

    tribe_get_events() is basically just a wrapper for Tribe__Events__Query::getEvents() so it gives the same result. But it turns out the issue was occurring somewhere else to limit the amount of events displayed. All sorted!

    Cheers,
    Brian

    #1120339
    Cliff
    Member

    Glad to hear. Thanks for letting me know you’re all good now. Have a great week.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Unable to query all events’ is closed to new replies.