Home › Forums › ACF PRO › ACF Pro Address Field Replacement › Reply To: ACF Pro Address Field Replacement
I believe it should be possible to get the below api response from google places api for an autocomplete address or from a lat/lng position pretty consistently (same principle is implemented in the Drupal Get Locations plugin). If some or all of the response is not present (e.g. a lat/lng in the ocean) the city/state/country field could be left empty. Shouldn’t this cover most use cases?
I will see if I can make this work with Elliot’s suggestion about the google_map_change event and hidden fields. But a native solution would be much more preferable.
“result” : {
“address_components” : [
{
“long_name” : “Amsterdam”,
“short_name” : “Amsterdam”,
“types” : [ “locality”, “political” ]
},
{
“long_name” : “Government of Amsterdam”,
“short_name” : “Government of Amsterdam”,
“types” : [ “administrative_area_level_2”, “political” ]
},
{
“long_name” : “North Holland”,
“short_name” : “NH”,
“types” : [ “administrative_area_level_1”, “political” ]
},
{
“long_name” : “Netherlands”,
“short_name” : “NL”,
“types” : [ “country”, “political” ]
}
],
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!
ACF’s Repeater field is a versatile solution for repeating content in #WordPress.
— Advanced Custom Fields (@wp_acf) December 29, 2022
What’s your favorite use case for the Repeater field?
What’s the weirdest thing you’ve ever used it for?
Let us know!👇
© 2023 Advanced Custom Fields.
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.