humanmade/Custom-Meta-Boxes — pull request #130 by mattheu (2013-11-25 18:37:59+00:00)
Title: Refactor Groups

In writing unit tests I discovered some of the code was not doing quite what I had expected - although it is functional.

Basically - the 'name' attributes used by groups are a bit wierd.

field_id[field_index] // Pattern used for field name attributes
group_id[group_index][field_id][field_index] // Expected group name attribute
group_id[field_id][group_index][field_index] // Actual name attribute used.

This means we have to do crazy stuff when parsing the save values.

This PR refactors so that the name attributes used by grouped field inputs follow the same pattern as standard fields, and the parse save values method can be simpler.

I think this also opens up the potential for nested groups, which I am unsure of from a UX perspective, but there is no reason they shouldn't be technically possible.