Created
November 25, 2012 23:47
-
-
Save davemac/4145907 to your computer and use it in GitHub Desktop.
WordPress hide certain plugins
This file contains 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
// thanks to Mike Little on WP-hackers | |
add_filter( 'all_plugins', 'dmc_remove_some_plugins' ); | |
function dmc_remove_some_plugins( $all ) { | |
global $current_user; | |
$remove_these = array( | |
'limit-login-attempts/limit-login-attempts.php', | |
'wordpress-firewall-2/wordpress-firewall-2.php', | |
'update-notifier/update-notifier.php', | |
'wp-super-cache/wp-cache.php', | |
'audit-trail/audit-trail.php', | |
); | |
if ( isset( $current_user ) && ( 1 != $current_user->id ) ) { | |
foreach( $all as $file => $data ) { | |
if ( in_array( $file, $remove_these ) ) | |
unset( $all[$file] ); | |
} | |
} | |
return $all; | |
} // end dmc_remove_some_plugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment