WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] tribe_get_events Seems to drop events too early (4 posts)

  1. randyjensen
    Member
    Posted 4 months ago #

    I'm pulling events in through an API using tribe_get_events. My code is pretty much straight out of the documentation.

    $all_events = tribe_get_events(
    array(
    'eventDisplay'=>'upcoming',
    'posts_per_page'=>5,
    'tax_query'=> array(
    array(
    'taxonomy' => 'tribe_events_cat',
    'field' => 'slug',
    'terms' => 'homepage'
    )))

    The problem is, there is an event from 11am-2pm today (April 23) that is _not_ coming back in this request. There is only 1 other event that should be coming back (which is) and the category is correctly checked.

    I've checked the time on the server and it's correct.

    I've changed the end time of the event to 11pm just to test it and it correctly comes back in the request.

    Are "upcoming" events dropped by hour in tribe_get_events? If so, is there a way to get around this without modifying the plugin?

    https://wordpress.org/plugins/the-events-calendar/

  2. Brook
    Modern Tribe Support Rep
    Plugin Author

    Posted 4 months ago #

    Howdy randy,

    The unfortunate truth is that bit of our documentation is out of date. I'd like to see an update to it soon. You might checkout this example query of how to query from a certain date forward: http://pastebin.com/fXNyTthe You should be able to adapt that to querying from a certain time forward. All of that is run through TribeEventsQuery::pre_get_posts(), so you might check there to get a better understanding of how it works. Hopefully soon we will have our documentation updated and this will no longer be necessary, but until then I hope that helps. Cheers!

    - Brook

  3. randyjensen
    Member
    Posted 4 months ago #

    Thanks for the reply Brook. I'll give that a shot!

  4. leahkoerper
    Modern Tribe Support Rep
    Plugin Author

    Posted 4 months ago #

    Thanks randy! Good luck!

Reply

You must log in to post.

About this Plugin

About this Topic