Hi there Luca, thanks for writing.
If you are inserting store locations with 3rd party tools, chances are the coordinates are not being properly calculated upon saving. Only if you save the store locations directly in the WordPress editor or if you use our csv manager add-on, you can make sure the corresponding reverse geocoding API call is being sent to Google Maps for retrieving the coordinates based on the address details. I think the issue may be related to that.
However if you want to give us more details on the specific website where this is happening, you can also open a support ticket directly with us.
Best regards,
Thread Starter
Luca
(@screenload)
Yeah I think the issue is that google maps data is not loaded when directly inserting the post via code that way.
Is there a plugin-function I can trigger via PHP to generate the coordinates on the new post?
Hi again, We do have an add-on for that, but it is against the WordPress public forum to promote paid add-ons, so I suggest you visit our website to find out more.
Best regards,
Thread Starter
Luca
(@screenload)
I think you misunderstood. Anyway I dug through your plugin code and found what I needed.
For anyone else reading this having the same issue:
$lat = get_post_meta($post_id, 'wpsl_lat', true);
$lng = get_post_meta($post_id, 'wpsl_lng', true);
$store_data = array(
'address' => get_post_meta($post_id, 'wpsl_address', true),
'city' => get_post_meta($post_id, 'wpsl_city', true),
'country' => get_post_meta($post_id, 'wpsl_country', true),
'lat' => '',
'lng' => '',
);
if (class_exists('WPSL_Geocode')) {
$geocoder = new WPSL_Geocode();
$geocoder->check_geocode_data($post_id, $store_data);
}
Hi again, sorry if I misunderstood you.
However I’m glad you figured that out 🙂
Best regards,