themeum / kirki

Extending the customizer
https://kirki.org
MIT License
1.26k stars 328 forks source link

Multiple attribute not working in Select fields in Repeaters #1736

Closed hellor0bot closed 6 years ago

hellor0bot commented 6 years ago

Issue description:

Even if multiple set to 0, it's always enabled in select fields in repeaters.

Version used:

Develop branch.

Using theme_mods or options?

Options.

Code to reproduce the issue (config + field(s))

Kirki::add_field(
    'theme_option', array(
        'type'        => 'repeater',
        'label'       => esc_html__( 'Social Accounts', 'text-domain' ),
        'section'     => 'connect',
        'priority'    => 10,
        'settings'    => 'social_accounts',
        'default'     => array(),
        'fields' => array(
            'type' => array(
                'type'        => 'select',
                'default'     => 'facebook',
                'multiple'    => 0,
                'choices'     => get_social_accounts(),
            ),
            'url' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Account URL', 'text-domain' ),
                'default'     => '',
            ),
            'text' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Button Text', 'text-domain' ),
                'default'     => '',
            ),
        ),
        'row_label' => array(
            'type' => 'field',
            'field' => 'type',
        ),
    )
);

Thanks!

hellor0bot commented 6 years ago

Fixed the issue by completely removing 'multiple' => 0,.