Fix the delete_user meta cap.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-09-04 12:24:43 +00:00
parent b97858641c
commit 713b3c1b82
1 changed files with 5 additions and 5 deletions

View File

@ -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' ) )