Home › Forums › Calendar Products › Events Calendar PRO › Get event categories
- This topic has 5 replies, 2 voices, and was last updated 6 years, 11 months ago by Matthew.
-
AuthorPosts
-
April 20, 2017 at 7:43 pm #1272481MatthewParticipant
The only event category information I can seem to get is the full HTML output used to build the Event Categories section of a single event.
There are these functions but they both return void:
https://theeventscalendar.com/function/tribe_get_event_cat_ids/
https://theeventscalendar.com/function/tribe_get_event_cat_slugs/Slugs would be great, names are fine, ids are likely fine if I can pull the remainder of the category information.
Is there any other way of pulling categories from an event in PHP?
April 24, 2017 at 3:11 pm #1273687CliffMemberMatthew, I understand you’re trying to obtain the Event Category taxonomies that an event has assigned to it.
Could you please provide the full code snippet you’re using to try to do this?
April 26, 2017 at 4:55 pm #1275009MatthewParticipantI have a hook:
function schedule_out_of_office($post_id) { /* Get Event Categories Here */ } add_action('save_post_tribe_events', 'schedule_out_of_office');
I use the event category to identify and trigger something elsewhere.
April 26, 2017 at 8:16 pm #1275038CliffMemberYou might want to reference save_post() and do this:
function schedule_out_of_office( $post_id, $post ) {
So that the $post is available to you as well. Maybe the data you’re looking for is in there.
If this doesn’t help you with your question, please describe the use case — if it’s for creating new events or updating existing events — maybe adding the other code snippet would help provide some context… but I hope the $post object will be sufficient for your needs, as suggested above.
Please let me know how this goes for you.
May 18, 2017 at 9:35 am #1285698Support DroidKeymasterHey 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 ‘Get event categories’ is closed to new replies.