Switch is not working in page builder correctly
Hello, team, just a report:
this not working if i use numeric values for Switch (only in page builder, but works in Theme options):
'my_option' => array(
'label' => __('Some option', 'textdomain'),
'type' => 'switch',
'value' => 0,
'right-choice' => array(
'value' => 1,
'label' => __( 'Yes', 'textdomain' )
),
'left-choice' => array(
'value' => 0,
'label' => __( 'No', 'textdomain' )
),
),
this works fine:
'my_option' => array(
'label' => __('Some option', 'textdomain'),
'type' => 'switch',
'value' => 'no',
'right-choice' => array(
'value' => 'yes',
'label' => __( 'Yes', 'textdomain' )
),
'left-choice' => array(
'value' => 'no',
'label' => __( 'No', 'textdomain' )
),
),
any ideas how to use numeric values for Switch in Page builder? :)
p.s. why i need numeric values?
$var == 1 will work faster than $var == 'yes' isn't right?
works for now on the switch but not sure about other options
tested switch with
0 , 1
false, true
'inactive','active'
worked in all 3 inside section options and than deeper inside addable-popup
thank you so much! Can I hope that this fix will be included in the official release?
@WPJobs Let me know if this feature is critical and urgent for your and I will create a new release approval asap.
If not, we sure will include this in official release but later, when more features and bug fixes will accumulate.
it is not critical, thank you a lot for a quick response and fix! :+1: