Home › Forums › Front-end Issues › ACF google map issue › Reply To: ACF google map issue
I don’t know the format of the array saved by ACF in the database. You’ll need to look at an existing one in the DB and make sure that you match it exactly.
Assuming that your format is right, always use the field key to update the field if it may not already be set with something. Using update_post_meta()
without manually adding the field key reference will not work. This ACF field type cannot work properly without the field key reference added to the database.
$field_name = 'field_5c892edd8235d';
$value = array('address'=>$google_location['address'], 'lat'=>$google_location['lat'], 'lng'=>$google_location['lng'], 'zoom'=>5);
update_field($field_name, $value, $property_id);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.