Support

Account

Home Forums Backend Issues (wp-admin) Upgrade to use Google Maps field type Reply To: Upgrade to use Google Maps field type

  • I closely read the update_field() documentation and built a template that pulls the old content into the new fields.

    Looked something like this, this is inside the loop:

    // switch on "show field keys", see http://www.advancedcustomfields.com/resources/update_field/
    $field_key = "field_somethingrandom"; //this is the new field
    $post_id = get_the_ID();
    
    // the $address, $latitude, $longitude values come from the old fields
    $value = array(
    "address" => $address,
    "lat" => $latitude,
    "lng" => $longitude
    );
    update_field( $field_key, $value, $post_id );

    Be sure to back up your database, this can mess up your data.