kirki icon indicating copy to clipboard operation
kirki copied to clipboard

required arguments don't work anymore after update

Open peterhadorn opened this issue 11 years ago • 9 comments

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' );

peterhadorn avatar Feb 27 '15 17:02 peterhadorn

tested in chrome and firefox

peterhadorn avatar Feb 27 '15 17:02 peterhadorn

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?

aristath avatar Feb 28 '15 01:02 aristath

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.

peterhadorn avatar Feb 28 '15 10:02 peterhadorn

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 avatar Feb 28 '15 14:02 peterhadorn

@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?

aristath avatar Feb 28 '15 18:02 aristath

yup, required arguments work again, thanks a lot :)

peterhadorn avatar Feb 28 '15 18:02 peterhadorn

Awesome!

I'll close this one, and we can work on the upload button issue on its separate thread on #35 :+1:

aristath avatar Feb 28 '15 19:02 aristath

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

DevelopOnline avatar Mar 27 '15 17:03 DevelopOnline

See https://github.com/aristath/kirki/issues/125

aristath avatar Mar 28 '15 16:03 aristath