Problem with Switch option in update 2.4.14
Hi)
I have used this option in my theme:
'berg_white_txt' => array( 'label' => esc_html__('White Text', 'berg'), 'type' => 'switch', ),
but after last update it doesn't work
Hello,
-
I added in
{theme}/framework-customizations/theme/options/settings.php$options = array( 'berg_white_txt' => array( 'label' => __('White Text', 'berg'), 'type' => 'switch', ), ); -
Added in
{theme}/functions.phpadd_action('init', function(){ if (empty($_POST)) fw_print( fw_get_db_settings_option('berg_white_txt') ); }); -
And everything works fine

but after last update it doesn't work
more details please
Hi) Thanks for your answer.
Yes it works in theme settings but it doesn't work in page builder.
For example I created Section in Page builder then I switched on "White
Text" and clicked save. But when I opened Section settings again White Text
wasn't changed. It was switched off.

But if I use 'berg_white_txt' => array( 'label' => esc_html__('White Text', 'berg'), 'type' => 'switch', 'left-choice' => array( 'value' => 'enabled', 'label' => ( 'Yes', 'fw' ), ), 'right-choice' => array( 'value' => 'disabled', 'label' => __( 'No', 'fw' ), ) ), instead 'berg_white_txt' => array( 'label' => esc_html('White Text', 'berg'), 'type' => 'switch', ),
it works correctly.
But I use this simple option: 'berg_white_txt' => array( 'label' => esc_html__('White Text', 'berg'), 'type' => 'switch', ), in all my theme and it is too hard to change all my options.
Is there simple way to fix it?
Thanks)
On Tue, Dec 29, 2015 at 4:14 PM, moldcraft [email protected] wrote:
but after last update it doesn't work
more details please
— Reply to this email directly or view it on GitHub https://github.com/ThemeFuse/Unyson/issues/1164#issuecomment-167767449.
..and there are not any problem before last update...
On Tue, Dec 29, 2015 at 5:18 PM, Rodal Ermakov [email protected] wrote:
Hi) Thanks for your answer.
Yes it works in theme settings but it doesn't work in page builder. For example I created Section in Page builder then I switched on "White Text" and clicked save. But when I opened Section settings again White Text wasn't changed. It was switched off.
But if I use 'berg_white_txt' => array( 'label' => esc_html__('White Text', 'berg'), 'type' => 'switch', 'left-choice' => array( 'value' => 'enabled', 'label' => ( 'Yes', 'fw' ), ), 'right-choice' => array( 'value' => 'disabled', 'label' => __( 'No', 'fw' ), ) ), instead 'berg_white_txt' => array( 'label' => esc_html('White Text', 'berg'), 'type' => 'switch', ),
it works correctly.
But I use this simple option: 'berg_white_txt' => array( 'label' => esc_html__('White Text', 'berg'), 'type' => 'switch', ), in all my theme and it is too hard to change all my options.
Is there simple way to fix it?
Thanks)
On Tue, Dec 29, 2015 at 4:14 PM, moldcraft [email protected] wrote:
but after last update it doesn't work
more details please
— Reply to this email directly or view it on GitHub https://github.com/ThemeFuse/Unyson/issues/1164#issuecomment-167767449.
also I have found "simple switch" in your shortcodes (section and special-heading) If you add section and switch Full width on, save and then reopen full width option will not be changed.
Please download the latest Unyson dev version, extract in wp-content/plugins/unyson and test all your shortcode modal options if the save works fine
Yes it works, Thank you very much)