I’m afraid that is hard to achieve and will consume a lot of resources. Basically, you can get the IDs of the posts that have “restaurant” as the category. After that, you can create queries by looping through these IDs to check if the value contains one of the ID. Unfortunately, it will generate a very long query when you have a lot of posts in a category.
What I suggest is to create a dummy field group for your Area post type to list all of the categories from the selected listing. That way, you can query the area based on the dummy field instead.
I hope this makes sense 🙂
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!
© 2022 Advanced Custom Fields.