kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Required option does not work in version 0.8.3

Open DevelopOnline opened this issue 11 years ago • 4 comments

Hi there

How can I use required settings in version 0.8.3?!

I have two controls:

    $controls[] = array(
        'type' => 'radio-buttonset',
        'setting' => 'my_bg_mode',
        'label' => 'Background Mode',
        'section' => 'my_default_section',
        'default' => 'normal',
        'priority' => $priority,
        'choices' => array(
            'normal' => 'Normal',
            'colorful' => 'Colorful',
        ),
        'transport' => 'postMessage'
    );

    $controls[] = array(
        'type' => 'color',
        'setting' => 'my_bg_color',
        'section' => 'my_default_section',
        'default' => '#cccccc',
        'priority' => $priority,
        'required' => array(
            array(
                'setting'  => 'my_bg_mode',
                'operator' => '==',
                'value'    => 'colorful')
            ),
        'transport' => 'postMessage'
    );

but my my_bg_color control is always visible! also when I click on my_bg_mode control buttons, nothing happens, & my_bg_color control is always visible.

Any Solution?!

Thanks in advance

DevelopOnline avatar Apr 06 '15 04:04 DevelopOnline

I have fixed this issue here (https://github.com/DevelopOnline/kirki/commit/0f70a3645b78a3d563971247508367e938ac065c)

DevelopOnline avatar Apr 06 '15 11:04 DevelopOnline

I have the same issue, both on radio buttons and image buttons, none of those required settings are working with 0.8.4

peterhadorn avatar Apr 08 '15 00:04 peterhadorn

The solution by DevelopOnline works perfect for me.

LuisAlejandre avatar Apr 10 '15 07:04 LuisAlejandre

This has been fixed in the master branch I'm closing this issue. :+1:

aristath avatar Apr 11 '15 20:04 aristath