I'm using this extension to create tabs from metaboxes:
https://github.com/stackadroit/cmb2-extensions
All working correct except when I try to add a group field, it doesn't respond, I tracked this down and found that when I use
'render_row_cb' => array( 'CMB2_Tabs', 'tabs_render_row_cb' ), on group field, it doesn't return anything to the function that is responsible for arranging the field into tabs which cause the group to be out of the wrapper and not within tabs.
so simple question, is there a way to return $field_args and $field from group field to the function, and I'll sort the rest.
You will need to open an issue on that repo.
@jtsternberg I did, I'm only asking here if there is a way to render group fields manually which is related to this repo.
sorry I meant I want it work with the group type itself, not group fields
$group_repeat = $cmb_repeat->add_field( array(
'id' => $prefix . 'group',
'type' => 'group',
'options' => array(
'group_title' => __( 'Product', 'cmb' ) . ' {#}', // {#} gets replaced by row number
'add_button' => __( 'Add Product', 'cmb' ),
'remove_button' => __( 'Remove Product', 'cmb' ),
// 'sortable' => true, // beta
),
'tab' => 'products',
'render_row_cb' => array( 'CMB2_Tabs', 'tabs_render_row_cb' ),
) );
It was not possible, but just pushed an update to enable this feature. I'd encourage you to proceed with caution when using the callback. Unless you keep it close to the original callback, you're likely to break something with the repeatable/sortable functionality.
Most helpful comment
It was not possible, but just pushed an update to enable this feature. I'd encourage you to proceed with caution when using the callback. Unless you keep it close to the original callback, you're likely to break something with the repeatable/sortable functionality.