kirki: active_callback and other bugs - Kirki 4
Issue description:
Here’s my initial impressions and problems i faced after upgrading to Kirki 4:
-
active_callback is not working across all options in my theme. it works fine with Kirki 3
-
Slider is not working properly, max number is not reaching the end of the slider.
-
CSS output is not working as well for many options. website design is crashed. Still investigating what options are not doing the output properly. (i have 100+ options unfortunately).
-
Switch control background when on is visible (solid blue).
Version used:
Kirki 4.0.3
Code to reproduce the issue (config + field(s))
Kirki::add_field( 'crave_config', array(
'type' => 'slider',
'settings' => 'option_width',
'label' => esc_attr__( 'Width', 'themename' ),
'section' => 'layout',
'priority' => 11,
'default' => '1200',
'choices' => array(
'min' => '960',
'max' => '1450',
'step' => '10'
),
'active_callback' => array(
array(
'setting' => 'wrapper_type',
'operator' => '!=',
'value' => 'slim',
)),
'output' => array(
array(
'element' => '.container',
'property' => 'max-width',
'units' => 'px',
),
array(
'element' => '.boxed',
'property' => 'max-width',
'units' => '',
'value_pattern' => 'calc($px + 50px)',
),
)
));
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (10 by maintainers)
Awesome, thank you! 😃
Sure. Provided that 4.0.6 fixed the problem, i will share the original case (which works again with no fix from my end after 4.0.6).
this is an
active_callbackvalue that is repeated for many options in a specific section.'active_callback' => $visibility,The fix was removing the nested arrays from
$visibilityand adding it again in the value
'active_callback' => array($visibility),Hi @mnmld , awesome! We’re also just fixed this issue (the
active_callback). Here is the link for the new build: v4.0.6 However, thank you for fixing it!And yes, we’re also still having the problem with the CSS output. Will let you know once we have fixed the CSS issue.
Just letting you know that with the next update, the min/max/step values can be passed as strings and don’t necessarily need to be integers any more. We’ve fixed that.
Please try to use integers, not strings in the code above. This should do the trick (just tested):