Hi I have the following group sub fields set up:
group_id
- subfield_1
- subfield_2
- subfield_3
The group can be cloned.
Doing a test to see if this works by using the following code, but it doesn't seem to work:
add_filter('rwmb_subfield_3_value', function($new, $field, $old) {
return 'Test Value';
}, 10, 3);
Secondly, since the group can be cloned, if I am trying to set the value of subfield_3 based on the value of subfield_2, how can I target/get the value of each cloned group's subfield_2 and set the corresponding subfield_3 value in the above filter?
If this were simple fields that cannot be cloned, then we could easily do something like:
if ( isset($_POST['field_2']) ) {
...do something to field_3 with field_2 value
}
But how do we target subfields for a group that can be cloned?