Skip to content
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

Repeatable fields not work in v2.2.6.1 #1058

Closed
anhskohbo opened this issue Nov 26, 2017 · 0 comments
Closed

Repeatable fields not work in v2.2.6.1 #1058

anhskohbo opened this issue Nov 26, 2017 · 0 comments

Comments

@anhskohbo
Copy link
Contributor

anhskohbo commented Nov 26, 2017

Expected Behavior:

The clone items not update the index in "name" attribute, see the screenshot:

screenshot from 2017-11-26 14-55-17

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,
	) );
}
anhskohbo added a commit to anhskohbo/CMB2 that referenced this issue Nov 26, 2017
@anhskohbo anhskohbo mentioned this issue Nov 26, 2017
jtsternberg added a commit that referenced this issue Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant