tribe get events for category

Home Forums Calendar Products Events Calendar PRO tribe get events for category

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1268864
    Bradley
    Participant

    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

    #1269823
    Shelby
    Participant

    Hi Bradley,

    Thanks for reaching out, I’d love to help you here! It sounds like you’re trying to make some pretty cool changes, which, as you know require some plugin/theme customization. Unfortunately, we’re not able to support development customizations to the plugin on these forums.

    However, I think you’ll find the following resources helpful:

    Themer’s Guide
    Functions List

    Let me know if I can be of more help here or clarify anything about our resources or support policies!

    Best,

    Shelby ?

    #1279348
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘tribe get events for category’ is closed to new replies.