Closed
Description
openedon May 25, 2015
custom options page fields within repeatable groups display array() if empty fields are saved.
the custom options page is calling the function below:
function theme_options_metabox($metabox_id, $key) {
$prefix = 'theme';
$cmb_options = new_cmb2_box( array(
'id' => $metabox_id,
'title' => 'Theme Options',
'hookup' => false,
'show_on' => array(
'key' => 'options-page',
'value' => array( $key )
)
) );
$group_field_id = $cmb_options->add_field( array(
'id' => $prefix . 'demo',
'type' => 'group',
'description' => __( 'Generates reusable form entries', 'cmb2' ),
'options' => array(
'group_title' => __( 'Entry {#}', 'cmb2' ),
'add_button' => __( 'Add Another Entry', 'cmb2' ),
'remove_button' => __( 'Remove Entry', 'cmb2' ),
'sortable' => true,
),
) );
$cmb_options->add_group_field( $group_field_id, array(
'name' => __( 'Entry Title', 'cmb2' ),
'id' => 'title',
'type' => 'text',
) );
}
wordpress version: 4.2.2
CMB2 version: 2.0.6
Metadata
Assignees
Labels
No labels
Activity