WordPress.org

Ready to get started?Download WordPress

Forums

Display Widgets
[resolved] Show only for Logged-out/in users can't be disabled (10 posts)

  1. urkekg
    Member
    Posted 1 year ago #

    Can you please ASAP update plugin and replace this code (line 267-270):

    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'];

    with this code:

    $instance['dw_logout'] = $new_instance['dw_logout'] ? 1 : 0;
        $instance['dw_login'] = $new_instance['dw_login'] ? 1 : 0;

    so when you enable any of both options, you can also disable it later. With current code you can only enable, but not disable this options.

    Cheers,
    Aleksandar

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

  2. Hassan
    Member
    Posted 1 year ago #

    I can confirm this issue as well. Show only for Logged-in/out users checkbox cannot be cleared once selected.

    Thinking about it, those two options should be radio buttons not checkboxes, right?

  3. urkekg
    Member
    Posted 1 year ago #

    No, radio buttons are optional (1st or 2nd), and can not be disabled (none of both).

    Checkboxes can be toggled.

    The bes option is dropdown list with 3 options (none, logged-in, logged-out).

    IMHO :)

  4. dvanderberg
    Member
    Posted 11 months ago #

    I am having the same problems with this widget.
    the replacement of the code does not work for me :(

    greetings
    Daniel

  5. tfmwa
    Member
    Posted 10 months ago #

    @urkekg
    Thank you SO much for posting the replacement code. It worked great on my site.

    It would be awesome if this issue could be resolved within the plugin. I love Display Widgets, but not being able to disable these options once they've been enabled can be quite troublesome.

    Unticking the box and saving the widget just causes the checkbox to become checked again at the moment.

  6. GeldGorilla
    Member
    Posted 10 months ago #

    Replacement code works good!

    But I don't see the widget when I tick 'Show only for logged in user' and when I am logged in.

    Anyone knows what the problem is?

  7. sswells
    Member
    Plugin Author

    Posted 5 months ago #

    This has been updated in v2.0. This option is a dropdown instead of check boxes now.

  8. GeldGorilla
    Member
    Posted 5 months ago #

    It works! Brilliant!

    But after updating the plugin almost all the widgets where on default 'Logged-in users', so I needed to change that first.

    Maybe you can make 'Everyone' as default...

  9. GeldGorilla
    Member
    Posted 5 months ago #

    Correction: I only had this on one site, the site where I changed the code like explained above so I don't think it is a problem for the normal plugin user.

  10. sswells
    Member
    Plugin Author

    Posted 5 months ago #

    Can you try 2.01 and let us know if you still have trouble? It was defaulting to logged in for existing widgets.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags