Support

Account

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);