Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Problem with Switch option in update 2.4.14

Open RodalErmakov opened this issue 10 years ago • 7 comments

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

RodalErmakov avatar Dec 29 '15 05:12 RodalErmakov

Hello,

  1. I added in {theme}/framework-customizations/theme/options/settings.php

    $options = array(
        'berg_white_txt' => array(
            'label' => __('White Text', 'berg'),
            'type' => 'switch',
        ),
    );
    
  2. Added in {theme}/functions.php

    add_action('init', function(){
        if (empty($_POST)) fw_print(
            fw_get_db_settings_option('berg_white_txt')
        );
    });
    
  3. And everything works fine

ghost avatar Dec 29 '15 11:12 ghost

but after last update it doesn't work

more details please

ghost avatar Dec 29 '15 11:12 ghost

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. fire2

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.

RodalErmakov avatar Dec 29 '15 12:12 RodalErmakov

..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.

RodalErmakov avatar Dec 29 '15 12:12 RodalErmakov

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.

RodalErmakov avatar Dec 29 '15 12:12 RodalErmakov

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

ghost avatar Dec 29 '15 13:12 ghost

Yes it works, Thank you very much)

RodalErmakov avatar Dec 29 '15 13:12 RodalErmakov