required arguments don't work anymore after update
Hi, I've upgraded to the new version and encountered an issue that required fields display all the time no matter what is selected in the parent setting. This worked beautifully in the old version. This is a sample code I use:
function swibu_layout_setting( $controls ) { $controls[] = array( 'type' => 'radio', 'mode' => 'image', 'setting' => 'layout_option', 'label' => __( 'Layout', 'swibu' ), 'section' => 'layout', 'default' => 0, 'priority' => 3, 'choices' => array( 0 => get_template_directory_uri() . '/lib/plugins/kirki/assets/images/1c.png', 1 => get_template_directory_uri() . '/lib/plugins/kirki/assets/images/2cl.png', 2 => get_template_directory_uri() . '/lib/plugins/kirki/assets/images/2cr.png', 3 => get_template_directory_uri() . '/lib/plugins/kirki/assets/images/3cm.png', ), ); return $controls; } add_filter( 'kirki/controls', 'swibu_layout_setting' );
function swibu_nav1_setting( $controls ) {
$controls[] = array(
'type' => 'radio',
'mode' => 'buttonset',
'setting' => 'navigation1',
'label' => __( 'Navigation', 'swibu' ),
'section' => 'layout',
'default' => 'option_1',
'priority' => 5,
'required' => array( 'layout_option' => 1 ),
'choices' => array(
'option_1' => __( 'Header', 'swibu' ),
'option_2' => __( 'Left Sidebar', 'swibu' ),
),
);
return $controls;
}
add_filter( 'kirki/controls', 'swibu_nav1_setting' );
tested in chrome and firefox
Hey there!
Could you please try with the latest version from the github repository instead of the version from w.org and let me know if you're still getting this issue there?
Thanks for your quick reply! I've just tried that, also on a new install, but the problem still persists. Everything else works perfectly, var_dump shows all the correct values.
I just found that the select file button in the upload control type also doesn't work anymore, it doesn't open the file selection window. This also used to work before the upgrade, I had not tested it since then. Could it be some sort of jQuery conflict in the backend?
@peterhadorn There was a bug... My colleague @briancwelch just fixed this, can you please re-check? The Upload button is still an issue related to https://github.com/aristath/kirki/issues/35 and we'll get to the bottom of this. The required arguments should work now though.... Can you please verify this?
yup, required arguments work again, thanks a lot :)
Awesome!
I'll close this one, and we can work on the upload button issue on its separate thread on #35 :+1:
Hi there, When customizer page loads, required fields display all the time no matter what is selected in the parent setting, and after re-select parent field, it works. But after (save &) refresh customizer page, it doesn't work again and required fields display again :(
Kirki version: master branch ver 0.7.1
Any solution?!
Thanks in advance
See https://github.com/aristath/kirki/issues/125