Hide Plugin From Plugin Screen

This is a great snippet for client sites. If you got your own custom plugin and want to prevent disabling your plugin – use this function. (rename the plugin name)

/**
 * Snippet Name: Hide Plugin From Plugin Screen
 * Snippet URL: https://www.wpcustoms.net/snippets/hide-plugin-from-plugin-screen/
 */
  function wpc_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;
}
add_filter( 'all_plugins', 'wpc_hide_plugins'); 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x