Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mattscottdesign

    (@mattscottdesign)

    I was able to resolve this by making the following change to widget-display-options.php:

    Line 181: Change $instance['wdo-display'] (both times) to: $new_instance['wdo-display']

    Will this change cause any other unforeseen issues?

    Thread Starter mattscottdesign

    (@mattscottdesign)

    I also just noticed this happening for the RSS widget — I’m not sure if it’s specific widget types, or if it’s just random. For at least these two widget types (Custom Menu and RSS), it ssems to be consistently not allowing me to change from Hide to Show.

    In case anyone else is struggling with this, I wrote this function as an alternative to is_active_sidebar() for the Display Widgets plugin. The comments explain it all. Stick this in your functions.php file, and then use has_visible_widgets() instead of is_active_sidebar().

    /* The Display Widgets plugin doesn't update
     * is_active_sidebar() for hidden widgets.
     * This function tests dynamic_sidebar() to
     * see if it is empty. Use instead of
     * is_active_sidebar() to determine if the
     * sidebar has any widgets. Remember to
     * change back to is_active_sidebar() if no
     * longer using Display Widgets.
     */
    function has_visible_widgets( $sidebar_id ) {
    
        // First check if sidebar has any widgets
        if ( is_active_sidebar($sidebar_id) ) {
            // Use PHP output buffer to load
            // the sidebar into a variable
            ob_start();
            dynamic_sidebar($sidebar_id);
            $sidebar = ob_get_contents();
            ob_end_clean();
            // Return false if sidebar is empty
            if ($sidebar == "") return false;
        } else {
            return false;
        }
    
        // Return true if sidebar is not empty
        return true;
    
    }
Viewing 3 replies - 1 through 3 (of 3 total)