Hi. I know I can create own rule, this is very useful and I often use it. But why create something that already exists ? Is there any reason I don’t know that explains why ACF gets all children of a page as WP_Post objects only to see if there is one child ?
Your code works well, but in my case, it filled my php memory and broke my page.
I made some more tests and in my case, your location rule code runs only once and takes around 2.5 seconds (!)… with the code above it takes around 0.0010 second.
I think it can be a good improvement for all ACF users & lovers like me.
Thank you for your consideration.
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!