This fix is a 3-way fix:
1) In entering an event in the CMS, only show the specific group fields if in the field dates_types the selected value is specific. And only show the complex group fields if complex is selected.
2) When saving an event, the post_meta values of the NOT-selected dates_types group fields are deleted, where CMB2 automatically saves them.
3) When retrieving an event via the REST API, the dates array and the next_date value is empty when the dates_types is complex but no rows are added in the group, and the same for the specific group.
This fix is a 3-way fix: 1) In entering an event in the CMS, only show the specific group fields if in the field dates_types the selected value is specific. And only show the complex group fields if complex is selected. 2) When saving an event, the post_meta values of the NOT-selected dates_types group fields are deleted, where CMB2 automatically saves them. 3) When retrieving an event via the REST API, the dates array and the next_date value is empty when the dates_types is complex but no rows are added in the group, and the same for the specific group.