Funny problem with the map when adding locations per script
-
Hi,
so far I have found no script, which enables me to import an xml file to Events Manager. Therefore I have writte myself a small function which parses an xml file and inserts the data into the Events Manager table. Everything seems fine, but here comes the problem:
I create a new location via:
//create new EM_Location object $new_location = new EM_Location(); $new_location->location_country = 'DE';//Typically my events are placed in Germany $new_location->location_town = 'Any Town you want'; $new_location->location_address = 'Any address you want; $new_location->location_state = 'Any state you want'; $new_location->location_name = 'Any Name you want'; $new_location->location_postcode = 'Guess what any postcode you want;); //check if location already exists $EM_Locations = EM_Locations::get(); $found_location = false; foreach($EM_Locations as $EM_Location){ if ($location == $EM_Location->name) { $found_location = true; $new_location->id = $EM_Location->id; } } if ($found_location == false) $new_location->save();Now if I insert real values for address etc. the location is correctly inserted into wordpress and everything works except the map. The Map is unfortunatly not loaded. Now I tried to leave one field blank and inserted the value on my own. This time the map is created, but only if I insert one value manually.
Can anyone give me a hint?
Thanks in advance!
Statistiker
The topic ‘Funny problem with the map when adding locations per script’ is closed to new replies.