Created
October 14, 2013 07:26
-
-
Save dionysia/6972069 to your computer and use it in GitHub Desktop.
Here is a WordPress snippet that will allow you to install the plugin and once it is activated it will be removed from the plugin screen so it can not be deactivated. The plugin will still be active and can be used as normal but it means that users can not deactivate these plugins. You can add the following into the theme functions.php file or c…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'all_plugins', 'hide_plugins'); | |
function hide_plugins($plugins) | |
{ | |
// Hide hello dolly plugin | |
if(is_plugin_active('hello.php')) { | |
unset( $plugins['hello.php'] ); | |
} | |
// Hide disqus plugin | |
if(is_plugin_active('disqus-comment-system/disqus.php')) { | |
unset( $plugins['disqus-comment-system/disqus.php'] ); | |
} | |
return $plugins; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment