Querying nested ACF component fields

I have several components inside another component which I added to a custom field for a custom post type.

Looking at the REST API, I see that my nested ACF components produce results like this:

“acf”: {
“location”: [
{
“type”: “country”,
“continent”: [
{
“continent”: “asia”
}
],
“country”: [
{
“country”: “bolivia”
}
],
“locality”: “”
}
],
}

So the value is nested pretty deep. (location[0].country[0].country). How can I query all posts and find records with a certain country name?

Read more here:: Querying nested ACF component fields

Leave a Reply

Your email address will not be published. Required fields are marked *