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.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.