kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Fix requiered

Open famfam opened this issue 11 years ago • 7 comments

required with operator != doesn't work in radio, radio-buttonset, radio-image.

famfam avatar May 07 '15 16:05 famfam

How to set up required (dependency) field? I can't find this in documentation

padalec avatar May 08 '15 07:05 padalec

@padalec

$controls[] = array(
        'type'        => 'select',
        'setting'     => 'select_demo_2',
        'label'       => __( 'This is the label', 'kirki' ),
        'description' => __( 'This is the control description', 'kirki' ),
        'help'        => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki' ),
        'section'     => 'select_section',
        'default'     => 'option-1',
        'priority'    => 10,
        'choices'     => array(
            'option-1' => __( 'Option 1', 'kirki' ),
            'option-2' => __( 'Option 2', 'kirki' ),
            'option-3' => __( 'Option 3', 'kirki' ),
            'option-4' => __( 'Option 4', 'kirki' ),
        ),
        'required' => array(
            array(
                'setting' => 'checkbox_demo',
                'operator' => '==',
                'value' => 1
            )
        )
    );

fovoc avatar May 09 '15 10:05 fovoc

Try now. I just deprecated the scripts and migrated the logic to use the new 'active_callback' that was recently introduced. :)

aristath avatar May 09 '15 18:05 aristath

How it works? Should I write my own function with the logic? There are documentation?

famfam avatar May 09 '15 19:05 famfam

Why swich/toggle looks like standard checkbox? Best regards

padalec avatar May 13 '15 12:05 padalec

Hey there,

you can still use the required option the way I mentioned before. In order to test the 'active_callback' functionality please pull the latest commit from master branch.

fovoc avatar May 13 '15 16:05 fovoc

This has been fixed and works on the dev version.

aristath avatar May 19 '15 15:05 aristath