Fix requiered
required with operator != doesn't work in radio, radio-buttonset, radio-image.
How to set up required (dependency) field? I can't find this in documentation
@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
)
)
);
Try now.
I just deprecated the scripts and migrated the logic to use the new 'active_callback' that was recently introduced. :)
How it works? Should I write my own function with the logic? There are documentation?
Why swich/toggle looks like standard checkbox? Best regards
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.
This has been fixed and works on the dev version.