Yeah im looking for a solution for this. When i was using Elementor i just need to set the adress and thats it. So when people fill a form with the adress automaticly map was update.
But now with LAT and Long is harder to set, and if you already have the info to 100 CPT or more is harder to use the widget and update.
I’ve not tested this in combination with bricks, but you can save the Lat & Long values in hidden ACF fields. With this code, you would need to save all 700 entries again, so maybe choose something different than ‘save_post’ to trigger the action for the first time…
Create two hidden fields:
map_lat and map_lng
Copy this code in the functions.php file of your child theme:
function acf_save_lat_lng( $post_id ) {
// get value of ACF map field
$value = get_field( 'map_adresse' ); // replace map_adresse with your ACF field name
global $post;
// update lat and lng as separate custom fields
update_post_meta( $post->ID, 'map_lat', $value['lat'] );
update_post_meta( $post->ID, 'map_lng', $value['lng'] );
}
// run after ACF saves the $_POST['acf'] data
add_action('save_post', 'acf_save_lat_lng', 20);
If you don’t mind buying a plugin, you could also use WP Gridbuilder. It has a very good map add-on.
Kinda sad, since i dont want to use another plugin. Already use like 15 and thats to huge. and more if i use woocommerce like 20. ill check that plugin, thanks.