Home › Forums › General Issues › Extracting City from Google Map Field › Reply To: Extracting City from Google Map Field
Hi @aaronrobb
While it would be possible to hook into acf/save_post and extract the value from the map field into another field (could be a hidden field if you like) I’m not sure how you would go about making sure you ONLY get the city.. It can be any length of string, with or without spaces etc. etc.
When I’ve had situations like this in the past I’ve actually used a custom taxonomy for location as well. It can be just for cities but you can also use a hierachial one and let the user apply country > region > city > part (really as far or not as you want).
The taxonomy makes for much better filtering options as well 🙂
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.