Stop duplication venues
-
Hi all,
I was surprised that venues were duplicated whenever I clicked on the UPDATE button. That’s why I wrote this code :$location = explode(',',$event['location'],2); $venues = tribe_get_venues(); $venue_exist = false; foreach($venues as $venue){ if (strtoupper($venue->post_title)==strtoupper($location[0])){ $args['Venue']['VenueID'] = $venue->ID; unset($args['Venue']['Venue']); unset($args['Venue']['City']); unset($args['Venue']['Country']); $venue_exist =true; break; } } if (!$venue_exist){ unset($args['Venue']['VenueID']); $args['Venue']['Venue'] = $location[0]; $args['Venue']['City'] = $location[0]; if ($location[1]<>''){$args['Venue']['Country'] = $location[1];}else{$args['Venue']['Country']='France';} }I replaced the line 140 of the sync-facebook-events.php file. By default, this line is :
$args['Venue']['Venue'] = $event['location'];Enjoy !
The topic ‘Stop duplication venues’ is closed to new replies.