-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
Expected Behavior:
The clone items not update the index in "name" attribute, see the screenshot:
CMB2 Field Registration Code:
add_action( 'cmb2_admin_init', 'yourprefix_register_theme_options_metabox' );
/**
* Hook in and register a metabox to handle a theme options page and adds a menu item.
*/
function yourprefix_register_theme_options_metabox() {
/**
* Registers options page menu item and form.
*/
$cmb_options = new_cmb2_box( array(
'id' => 'yourprefix_theme_options_page',
'title' => esc_html__( 'Theme Options', 'cmb2' ),
'object_types' => array( 'options-page' ),
'option_key' => 'yourprefix_theme_options',
'icon_url' => 'dashicons-palmtree',
) );
$cmb_options->add_field( array(
'name' => esc_html__( 'Site Background Color', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'bg_color',
'type' => 'text',
'default' => '#ffffff',
'repeatable' => true,
) );
}Metadata
Metadata
Assignees
Labels
No labels
