tribe get events for category

Home Forums Welcome! Pre-Sales Questions tribe get events for category

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1267350
    Matt
    Guest

    I am trying to change the API to get events under a chosen Category.

    I currently have this code to get a response for events between dates and then events between dates with a tag

    function tribe_api_query( $query ) {
    $events = tribe_get_events( array(
    ‘eventDisplay’ => $query[‘eventDisplay’],
    ‘start_date’ => $query[‘start_date’],
    ‘end_date’ => $query[‘end_date’],
    ‘tag’ => $query[‘tag’]
    ) );
    if ( empty( $events ) ) {
    return null;
    }
    return $events;
    }
    add_action( ‘rest_api_init’, function () {
    register_rest_route( ‘tribe_events/v2’, ‘/events/(?P<eventDisplay>[a-z\-]+)/(?P<start_date>[a-z0-9\-]+)/(?P<end_date>[a-z0-9\-]+)/(?P<tag>[a-z\-]+)’, array(
    ‘methods’ => ‘GET’,
    ‘callback’ => ‘tribe_api_query’,
    ) );
    } );

    add_action( ‘rest_api_init’, function () {
    register_rest_route( ‘tribe_events/v2’, ‘/events/(?P<eventDisplay>[a-z\-]+)/(?P<start_date>[a-z0-9\-]+)/(?P<end_date>[a-z0-9\-]+)’, array(
    ‘methods’ => ‘GET’,
    ‘callback’ => ‘tribe_api_query’,
    ) );

    } );

    I need to add another response to get events between dates with a category chosen. I cannot find documentation to add a category in a similar way i added tag.

    Thanks in advance

    #1267794
    Matt
    Guest

    Still lost if anyone can help

    #1268021
    Caroline
    Member

    Hi Matt,

    Thanks so much for getting in touch! I’m afraid that we’re not equipped to provide technical support for current plugin users here in our pre-sales forum. We’d be more than happy to assist you at one of the following locations:

    If you can, please take the time to confirm in your post that you’ve run through our conflict testing steps prior to contacting us–this will save us a step and help us to get your issue resolved that much quicker! 🙂

    Thanks again, and we’ll see you in the forums!

    #1277429
    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 for category’ is closed to new replies.