Home › Forums › General Issues › Disable Entire Field Group via Another ACF Field (in Separate Group) › Reply To: Disable Entire Field Group via Another ACF Field (in Separate Group)
You could build custom location rules based on all of the possible fields.
I would not go that far.
For something like this I would create an acf/load_field_group filter. This is an undocumented filter hook but there is a small example that can be found here.
In this filter I would modify the location rules for each group and add custom location rules that way.
Then build just the “rule match” function for each of my custom fields. This can be done with just the "acf/location/rule_match/{$rule}"
filter without building an entire class for each of your custom location rules. Examples of this can be found some of my examples here https://github.com/Hube2/acf-filters-and-functions
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.