Home › Forums › ACF PRO › Output taxonomy terms by a meta field value › Reply To: Output taxonomy terms by a meta field value
This will only work if your using ACF >= 5.5.0
The first thing you need is a list of terms country terms using get_terms() https://developer.wordpress.org/reference/functions/get_terms/
The next step is to loop though the list counties and do another get_terms() with a meta_query value to match the country. The meta_query follows the same syntax as meta_query for WP_Query() https://codex.wordpress.org/Class_Reference/WP_Query
If you’re not using ACF5 this will be far more complicated.You’ll need to get all of the city terms and then loop through them manually and get the custom field for each one and short them all by country.
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.