New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
cmb2-flexible-content-field.php
Outdated
$field_group = $flexible_field->get_field_clone( $group_args ); | ||
$field_group->data_to_save = $values; | ||
|
||
// // The saved array is used to hold sanitized values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra comment marks
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.