Facebook Imports: No Categories

Home Forums Calendar Products Event Aggregator Facebook Imports: No Categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1132093
    gerikg
    Participant

    Just following up on this: https://theeventscalendar.com/support/forums/topic/facebook-import-no-categories/

    I don’t see an option for the categories.

    Here are the fb categories

    The plugin is great. Any plans to import the categories too or have it “match” with the current ones on WP?

    If no, would this be a paid service?

    Here are the facebook event categories

    Arts
    -Art
    -Books
    -Film
    Causes
    -Fundraiser
    -Volunteering
    Community
    -Family
    -Festival
    -Neighborhood
    -Religious
    -Shopping
    Entertainment
    -Comedy
    -Concert
    -Dance Performance
    -Nightlife
    -Theater
    Food & Drinks
    -Dinning
    -Tasting
    Interests
    -Conference
    -Meetup
    Learning
    -Class
    -Talk
    -Workshop
    Sports & Fitness
    -Fitness
    -Sports Game
    Other Category

    #1132488
    George
    Participant

    Hey @gerikg,

    Thanks for reaching out!

    The hook that Brian mentioned in that thread indeed exists now, and you can use it to assign a category to all events upon import.

    Now, it’s a bit tricky to assign per-event categories, i.e. it is a bit tricky to have one event go into one category, then another event into another category, and so on. But this is possible to some degree.

    But you can use the event, venue, and organizer information to assign a category to events.

    The new hook is called tribe_events_facebook_event_created.

    ☝️ That action is fired when an event is imported from Facebook and successfully created within WordPress.

    Here’s an example of how to use that action:


    function tribe_add_categories_to_fb_events_upon_import( $event_id, $organizer_id, $venue_id ) {

    if ( ! $event_id )
    return;

    // An array of IDs of event categories we want this event to have.
    $cat_ids = array( 6, 8 );

    wp_set_object_terms( $event_id, $cat_ids, 'tribe_events_cat' );
    }

    add_action( 'tribe_events_facebook_event_created', 'tribe_add_categories_to_fb_events_upon_import', 10, 3 );

    We cannot yet pull the categories from Facebook, but with this hook you can achieve many things upon the importing of an event and I hope this helps.

    Let me know what you think, and what other questions you might have on this.

    Thank you!
    George

    #1132489
    gerikg
    Participant

    Does this help? It mentions the categories
    https://developers.facebook.com/docs/graph-api/reference/event

    #1132505
    George
    Participant

    Hey @Gerikg,

    Thanks for sharing this! This refers to the Facebook API’s implementation of its own categories structure; our plugins do not handle these categories or import them from Facebook at this time.

    Sorry to disappoint about that—I hope the information I shared in my previous is helpful nonetheless!

    Sincerely,
    George

    #1138707
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Facebook Imports: No Categories’ is closed to new replies.