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

  1. urkekg
    Posted 3 years ago #

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

            $instance['dw_logout'] =  $new_instance['dw_logout'];
            $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.



  2. Hassan
    Posted 3 years 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
    Posted 3 years 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
    Posted 2 years ago #

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


  5. tfmwa
    Posted 2 years ago #

    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
    Posted 2 years 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. Steph Wells
    Plugin Author

    Posted 2 years ago #

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

  8. GeldGorilla
    Posted 2 years 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
    Posted 2 years 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. Steph Wells
    Plugin Author

    Posted 2 years 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

  • Display Widgets
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic