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:
parent
b97858641c
commit
713b3c1b82
|
@ -799,9 +799,6 @@ function map_meta_cap( $cap, $user_id ) {
|
||||||
case 'remove_user':
|
case 'remove_user':
|
||||||
$caps[] = 'remove_users';
|
$caps[] = 'remove_users';
|
||||||
break;
|
break;
|
||||||
case 'delete_user':
|
|
||||||
$caps[] = 'delete_users';
|
|
||||||
break;
|
|
||||||
case 'promote_user':
|
case 'promote_user':
|
||||||
$caps[] = 'promote_users';
|
$caps[] = 'promote_users';
|
||||||
break;
|
break;
|
||||||
|
@ -1028,10 +1025,13 @@ function map_meta_cap( $cap, $user_id ) {
|
||||||
case 'delete_user':
|
case 'delete_user':
|
||||||
case 'delete_users':
|
case 'delete_users':
|
||||||
// If multisite these caps are allowed only for super admins.
|
// 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';
|
$caps[] = 'do_not_allow';
|
||||||
else
|
} else {
|
||||||
|
if ( 'delete_user' == $cap )
|
||||||
|
$cap = 'delete_users';
|
||||||
$caps[] = $cap;
|
$caps[] = $cap;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'create_users':
|
case 'create_users':
|
||||||
if ( is_multisite() && !get_site_option( 'add_new_users' ) )
|
if ( is_multisite() && !get_site_option( 'add_new_users' ) )
|
||||||
|
|
Loading…
Reference in New Issue