Support

Account

Home Forums ACF PRO Hide a field group from showing until other value is set

Solved

Hide a field group from showing until other value is set

  • I have a post type which has 2 field groups, let’s say A and B. I would like to hide group B if no value is set for field X in group A.

    I don’t mind if the user has to save the post first to store field X in group A.

  • I tried several things like:

    remove_meta_box( 'acf-group_5adf5e5737453', 'pg_template', 'normal' );
    remove_meta_box( 'acf-group_5adf5e5737453', 'post', 'normal' );

    these are loaded, through a function which hooks into admin_init.

  • I have solved it by taking a different approach. I was trying to ‘create’ this on the back-end but realised I only need this on the front-end since everything will be managed through front-end forms.

    So I built a function to determine if the value is set and based on that an extra group is loaded (or not).

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

The topic ‘Hide a field group from showing until other value is set’ is closed to new replies.