Support

Account

Home Forums General Issues Disable Entire Field Group via Another ACF Field (in Separate Group)

Helping

Disable Entire Field Group via Another ACF Field (in Separate Group)

  • I have a large “Website Settings” area using the Options Add-on where certain functions, data are set up, defined, etc. for the entire site.

    I also have a bunch of ACF groups for various CPTS, Users, Custom Functions, etc.

    What I’d like to do is to completely enable / disable (Radio Button Fiel) an entire field group based on an ACF in the site Options group. Almost like conditional logic control for the entire group, triggered from a separate field.

    I assume it will take some custom function(s). Is this possible and which direction should I look further?

    Thanks!

  • 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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.