• Resolved kymbo71

    (@kymbo71)


    Hi,

    We are importing events from Eventbrite. Any event with a Location of “Online event” is being imported with no venue. Is there a way to ensure all imported events have a venue specified or fall back to a default venue if empty?

    Thanks, Kym.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @kymbo71

    Glad you reached out.

    Thanks for bringing this to our attention.

    We have an internal ticket (EA-223) to review this. In the meantime, please try the following code snippet:

    add_filter('tribe_aggregator_before_insert_event', 'tribeEventContentFilter');
    add_filter('tribe_aggregator_before_save_event', 'tribeEventContentFilter');
    function tribeEventContentFilter($event) {
        if (isset($event['eventbrite']) && $event['eventbrite']->online_event == true) {
            $venue = get_page_by_title('Online Event', 'OBJECT', Tribe__Events__Venue::POSTTYPE);
            if (!$venue) {
                $newVenue = ['Venue' => 'Online Event'];
                $event['EventVenueID'] = Tribe__Events__Venue::instance()->create($newVenue, null, true);
            } else {
                $event['EventVenueID'] = $venue->ID;
            }
        }
        return $event;
    }

    Please let us know how it goes.

    Thanks
    Rob

    Plugin Support WilloftheD

    (@abzlevelup)

    Hey @kymbo71, this thread has been inactive for a while, so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up, and we’d be happy to help.

    Cheers,
    Abz

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Default venue from Eventbrite’ is closed to new replies.