WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Bug for checkbox save

[Resolved] Bug for checkbox save

  • Hi,

    there is a bug I got with version 1.24.

    How to reproduce : I check one of the following checkboxes : show to logged-in users – show to not logged-in users

    What happen : if uncheck and save, it won’t be saved, it remains checked

    Solution : in function “dw_update_widget_options”, if $new_instance[‘dw_logout’] or $instance[‘dw_login’] is not set, nothing is saved, but 0 should be saved

    Thank you for you plugin!

    http://wordpress.org/extend/plugins/display-widgets/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Johann,

    falls Du deutsch sprechen solltest:
    Kannst Du den genauen Code, den man ersetzen muss, bitte posten.

    English:
    Could you please post the right code in here.
    I couldnt understand your solution…

    Thank you

    Hier bitte :

    display-widgets.php -> dw_update_widget_options() l. 267

    Change

    if(isset($new_instance['dw_logout']))
            $instance['dw_logout'] =  $new_instance['dw_logout'];
        if(isset($new_instance['dw_login']))
            $instance['dw_login'] = $new_instance['dw_login'];

    Into

    if(isset($new_instance['dw_logout']))
            $instance['dw_logout'] =  $new_instance['dw_logout'];
        else
            $instance['dw_logout'] =  0;
    
        if(isset($new_instance['dw_login']))
            $instance['dw_login'] = $new_instance['dw_login'];
        else
            $instance['dw_login'] = 0;

    Vielen Dank! 😉

    Plugin Author Steph Wells

    @sswells

    This has been updated in v2.0. Sorry for the delay.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Bug for checkbox save’ is closed to new replies.