Support » Plugin: WPide » hide_wp_sidebar_nav filter not always returning $classes

  • Hi

    In this file: ~/wpcontent/plugins/wpide/WPide.php on line #144, you have this code:

    public function hide_wp_sidebar_nav($classes) {
            global $hook_suffix;
    
    		if ( apply_filters( 'wpide_sidebar_folded', $hook_suffix === $this->menu_hook ) ) {
    	    	return  str_replace("auto-fold", "", $classes) . ' folded';
    		}
        }

    But the method should always return $classes, whether it’s been modified or not. Can you change it to this:

    public function hide_wp_sidebar_nav($classes) {
            global $hook_suffix;
    
    		if ( apply_filters( 'wpide_sidebar_folded', $hook_suffix === $this->menu_hook ) ) {
    	    	return  str_replace("auto-fold", "", $classes) . ' folded';
    		}
    
    		return $classes;
        }

    Thanks
    Eric

    https://wordpress.org/plugins/wpide/

  • The topic ‘hide_wp_sidebar_nav filter not always returning $classes’ is closed to new replies.