Home › Forums › General Issues › Query posts by custom field 'Google Map' › Reply To: Query posts by custom field 'Google Map'
The ACF google map field stores a serialized array of values. It is impossible to search these values in the manner you describe.
In order to do a search on longitude and latitude you would need to create an acf/save_post filter. In this filter you get the value of the ACF google map field without formatting.
$value = get_field('map-field-name', $post_id, false)
You would then save these values into WP custom meta using update_post_mata(). You can then uses these fields for your search.
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.