Home › Forums › Welcome! › Pre-Sales Questions › tribe get events for category
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by
Support Droid.
-
AuthorPosts
-
April 9, 2017 at 12:01 pm #1267350
Matt
GuestI 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
April 10, 2017 at 11:31 am #1267794Matt
GuestStill lost if anyone can help
April 10, 2017 at 7:21 pm #1268021Caroline
MemberHi 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’re using one or more of our free plugins such as The Events Calendar and Event Tickets, you can request assistance on the WordPress.org support forum for the affected product.
- If you’re a current license holder for one of our premium offerings, please log in to your account and submit a post to the appropriate forum for the affected product.
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!
May 2, 2017 at 9:35 am #1277429Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘tribe get events for category’ is closed to new replies.
