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).