Get event categories

Home Forums Calendar Products Events Calendar PRO Get event categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1272481
    Matthew
    Participant

    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?

    #1273687
    Cliff
    Member

    Matthew, 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?

    #1275009
    Matthew
    Participant

    I 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.

    #1275038
    Cliff
    Member

    You 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.

    #1285698
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Get event categories’ is closed to new replies.