Hide mu-plugins list

I’m using mu-plugins, http://codex.wordpress.org/Must_Use_Plugins.

These plugins are showing in plugins.php, http://d.pr/i/JIvX.

Read More

Is there any way to hide it?

Thanks.

Related posts

2 comments

  1. The solution to this request is filtering show_advanced_plugins. This filter is called twice, once for mustuse– and once for dropins-plugins.

    The filter accepts two parameters, the first one being the standard value (true), and the second one being the type of the advanced plugin (Must-Use and Drop-In).

    So returning false does the trick, if your condition is met. If you want Dropt-Ins to be hidden as well, just set the function to return false.

    Please be aware that a Plugin can alter this filter, so you may have to change the priority to achieve the desired results (3rd parameter). Also return the $default value in the standard case, to allow other functions the same functionality.

    And here comes the code:

    add_filter( 'show_advanced_plugins', 'f711_hide_advanced_plugins', 10, 2 );
    
    function f711_hide_advanced_plugins( $default, $type ) {
        if ( $type == 'mustuse' ) return false; // Hide Must-Use
        return $default;
    }
    
  2. You can hook into the views_plugins filter and unset the mustuse item:

    function my_remove_mu_plugins( $views ){
        if ( isset($views['mustuse']) )
            unset($views['mustuse']);
        return $views;
    }
    add_filter('views_plugins','my_remove_mu_plugins');
    

    Note: It will still be possible to access the mu plugins list by entering an url like plugins.php?plugin_status=mustuse.

Comments are closed.