tribe_get_events() parameters not affecting query

Home Forums Calendar Products Events Calendar PRO tribe_get_events() parameters not affecting query

  • This topic has 0 replies, 2 voices, and was last updated 6 years ago by thecolumbian.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1491181
    thecolumbian
    Participant

    I am trying to query for events using tribe_get_events() but it doesn’t appear to be working properly. For example, this simple example is returning events, but ignoring the start and end date put in entrirely:

    tribe_get_events( array(
    	'start_date' => '2015-06-01 00:00',
    	'end_date'   => '2015-06-30 23:59'
    ));

    It seems like the only parameter I can get to accurately work is the ‘posts_per_page’ parameter. Any ideas?

    #1491766
    thecolumbian
    Participant

    Another example (and there are plenty) – when I try to specify a category, it returns nothing:

    tribe_get_events(
    	array(
    		'posts_per_page' => 1,
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'tribe_events_cat',
    				'field'    => 'slug',
    				'terms'    => 'business',
    			),
    		),
    	)
    );

    If it helps at all, this function is hooked in from a custom plugin to the “tribe_plugins_loaded” hook.

    • This reply was modified 6 years ago by thecolumbian. Reason: spelled "category" wrong
    • This reply was modified 6 years ago by thecolumbian. Reason: extra hook detail
    #1493139
    Victor
    Keymaster

    Hi Brandon!

    Thanks for reaching out to us! Let me help you with this topic.

    First, please allow me to note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    The problem could be where the tribe_get_events() function is being called in. You could try placing your custom code inside your theme functions.php file and see if any difference.

    Let me point you to our Extensions repository where you’ll find an extension template you can use as reference > https://github.com/moderntribe/products-extensions

    Hope that helps. Let me know if any other questions.

    Best,
    Victor.

    #1512917
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘tribe_get_events() parameters not affecting query’ is closed to new replies.