Set default category for Facecbook Importer

Home Forums Calendar Products Event Aggregator Set default category for Facecbook Importer

  • This topic has 3 replies, 4 voices, and was last updated 7 years, 8 months ago by Constantino Thamnopoulos.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1137143

    I would like that all Facebook imported event go to a specific category.

    I look up on the forum and I found this:

    https://theeventscalendar.com/support/forums/topic/set-default-category-for-facecbook-importer/

    but the location of the coding provided seems not to be valid any more.

    Can you help me to achieve this functionality?
    Please anyone that read this consider Im an amateur on WordPress.

    Have a lovely day!

    #1138074
    Nico
    Member

    Howdy Constantino,

    Welcome to our support forums and thanks for reaching out to us! I’ll help you here…

    Just add the snippet below to your theme’s (or child theme’s) functions.php file:


    /* Set a default category for facebook imported events */
    function tribe_set_facebook_category ( $event_id, $organizer_id, $venue_id ) {
    wp_set_object_terms( $event_id, 'cat-slug', Tribe__Events__Main::TAXONOMY, false );
    }

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

    Be sure to change cat-slug for the real event category slug in your site!

    Please let me know if this works for you,
    Best,
    Nico

    #1146583
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Set default category for Facecbook Importer’ is closed to new replies.