Merge pull request #6108 from barrykooij/fix/6095

Only add the 'do_not_allow' if target user ($args[0]) is set.
This commit is contained in:
Mike Jolley 2014-08-28 10:08:09 +01:00
commit 5d8d30bba3
1 changed files with 1 additions and 3 deletions

View File

@ -361,9 +361,7 @@ function wc_modify_map_meta_cap( $caps, $cap, $user_id, $args ) {
case 'promote_user' :
case 'delete_user' :
case 'delete_users' :
if ( ! isset( $args[0] ) ) {
$caps[] = 'do_not_allow';
} elseif ( $args[0] === $user_id ) {
if ( ! isset( $args[0] ) || $args[0] === $user_id ) {
break;
} else {
if ( user_can( $args[0], 'administrator' ) && ! current_user_can( 'administrator' ) ) {