Support

Account

Home Forums General Issues Dynamically populate the Lat & Lng values with other fields value Reply To: Dynamically populate the Lat & Lng values with other fields value

  • https://www.advancedcustomfields.com/resources/acf-prepare_field/

    
    add_filter('acf/prepare_field/name=map', 'my_prepare_map_field');
    function my_prepare_map_field($field) {
      $field['center_lat'] = get_field('latitude', $post_id);
      $field['center_lng'] = get_field('longitude', $post_id);
      return $field;
    }