Created
March 5, 2019 18:12
-
-
Save woodwardtw/c3e3471795799f163bd0f52fdb510349 to your computer and use it in GitHub Desktop.
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
add_filter('map_meta_cap', 'less_super_admins', 10, 4); | |
function less_super_admins($caps, $cap, $user_id, $args){ | |
$super = array( | |
'update_core', | |
'update_plugins', | |
'update_themes', | |
'upgrade_network', | |
'install_plugins', | |
'install_themes', | |
'delete_themes', | |
'delete_plugins', | |
'edit_plugins', | |
'edit_themes', | |
'delete_sites', | |
'setup_network', | |
'manage_network_plugins', //these are big removals of all the access to these items | |
'manage_network_themes', | |
'manage_network_options', | |
); | |
$still_super = [1];//user IDs for super admins to retain FULL RIGHTS - all other super admins are limited as defined above | |
if($user_id != in_array($user_id,$still_super) && in_array($cap, $super)) { | |
$caps[] = 'do_not_allow'; | |
} | |
return $caps; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment