Hi there,
I believe that the Switch
custom field element when used as MB Group subfield cannot be set to the default "On" status when "cloned".
When a MB Group subfield Switch
element uses the 'std' => true,
attribute the FIRST subfield group element respects the attribute and the default "On" status is set. Subsequent MB Group subfield clones DO NOT respect the 'std' => true,
attribute.
To Re-Create:
=============
1) Create a new 'type' => 'group',
custom field ensuring that 'clone' => true,
is set.
2) Add some sub-fields ensuring that you include the following Switch
element within them:
[
'id' => 'enable_switch',
'name'. => 'Enable This',
'type' => 'switch',
'style' => 'square',
'on_label' => 'Enabled',
'off_label' => 'Disabled',
'std' => true, // Default On
],
3) Test the new group subfields clone creation and observe the switch status.
I can confirm that...
1) The issue is present in both a MB Frontend Submission Form and in the WP-ADMIN when creating group clones.
2) The issue is present with either 'clone_empty_start' => true,
OR 'clone_empty_start' => false,
within the group settings.
Q) Is this expected behaviour?
Q) Can you also re-create this scenario?
I look forward to your response.