Fix the delete_user meta cap.
git-svn-id: https://develop.svn.wordpress.org/trunk@15561 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d62e022459
commit
65fdbfec3f
@ -799,9 +799,6 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'remove_user':
|
||||
$caps[] = 'remove_users';
|
||||
break;
|
||||
case 'delete_user':
|
||||
$caps[] = 'delete_users';
|
||||
break;
|
||||
case 'promote_user':
|
||||
$caps[] = 'promote_users';
|
||||
break;
|
||||
@ -1028,10 +1025,13 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'delete_user':
|
||||
case 'delete_users':
|
||||
// If multisite these caps are allowed only for super admins.
|
||||
if ( is_multisite() && !is_super_admin( $user_id ) )
|
||||
if ( is_multisite() && !is_super_admin( $user_id ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
else
|
||||
} else {
|
||||
if ( 'delete_user' == $cap )
|
||||
$cap = 'delete_users';
|
||||
$caps[] = $cap;
|
||||
}
|
||||
break;
|
||||
case 'create_users':
|
||||
if ( is_multisite() && !get_site_option( 'add_new_users' ) )
|
||||
|
Loading…
Reference in New Issue
Block a user