One big group#8
Conversation
Add javascript select
…cmb2-flexible-content into plugin-structure
|
Also, something that would make this way easier in CMB2. If there was a way to edit a fields |
|
CMB2/CMB2@1882114 should help with that. Will just need to modify the field's $field->set_prop( 'options', $new_modified_options );
$field->set_options(); |
|
Yea the problem was trying to modify it after |
|
Oh and thanks for the commit @jtsternberg! Should make things easier. |
Right, but now you can call set_options at any arbitrary time, to reset the field options array. |
|
Oh right, perfect! |
| $field_group = $flexible_field->get_field_clone( $group_args ); | ||
| $field_group->data_to_save = $values; | ||
|
|
||
| // // The saved array is used to hold sanitized values. |
This reverts commit a1f118c.
71804eb to
85558d3
Compare
This takes a slightly different approach from #5. Instead of creating new groups for each set of fields, this replaces the existing field with a single group, then swaps fields in and out to render data.
Some advantages there:
The disadvantage being that the CMB2 Field instance has to be cloned and recreated fairly often, but that is really just building up an array, and it is more or less the same as creating a new group for each individual data block.