Required arguments not working until i hit save.
I am following the documentation and it seems i cant make it to work real time. The fields where i added the required arguments only show when i hit save or when the browser refreshed.
Below is the code i created.
$fields[] = array(
'type' => 'radio',
'settings' => 'htypes',
'label' => __( '', 'kirki' ),
'description' => __( '', 'kirki' ),
'section' => 'header_types',
'priority' => 10,
'choices' => array(
'widget' => __( 'Widgetized', 'kirki' ),
'predef' => __( 'Predefined', 'kirki' ),
),
);
$fields[] = array(
'type' => 'radio-image',
'settings' => 'headtype',
'label' => __( '', 'kirki' ),
'description' => __( '', 'kirki' ),
'section' => 'header_types',
'priority' => 20,
'default' => 'htypes1',
'choices' => array(
'htypes1' => __( 'First Option', 'kirki' ),
'htypes2' => __( 'Second Option', 'kirki' ),
),
'required' => array(
array(
'setting' => 'htypes',
'value' => 'predef',
'operator' => '==',
),
)
);
Any help are highly appreciated.
Thanks
Do you have your theme somewhere I can download and test this? I can't replicate the issue you're having so it may depend on the rest of your code.
Hi aristath,
Already send the theme via email.
Thanks
'active_callback' option #227 tried to follow the instruction here but still not working for me. That's why i opted out to reach you and open this ticket.
Thanks
@randomideas I replied to you on email. This seems to work fine using your config on other themes so there must be something else wrong. I also sent you on email a sample theme where this works using your configuration & fields so I'm closing this one as it's not a Kirki bug.