Home › Forums › Feature Requests › Access country from a Google Maps geocoding request › Reply To: Access country from a Google Maps geocoding request
Ok, I found out how to do this myself. It requires the following changes and I’d be glad to have them added.
In acf-input.js #5307:
$.each(location.address_components,function(key,item){
if (item.types[0] == 'country') {
acf.val( self.$el.find('.input-country'),item.short_name);
}
});
Another change goes to google-map.php #84 ,the array gets one more entry after lang
:
'country' => ''
These small changes add the short_name of the country to the saved 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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.