Fix revoke_super_admin(). see #12933.

git-svn-id: https://develop.svn.wordpress.org/trunk@14042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-04-09 07:17:42 +00:00
parent a214b120c4
commit 213aca7b04

View File

@ -831,18 +831,18 @@ function revoke_super_admin( $user_id ) {
do_action( 'revoke_super_admin', $user_id );
$admin_email = get_site_option( 'admin_email' );
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
$user = new WP_User( $user_id );
if ( $user->user_email != $admin_email ) {
foreach ( $super_admins as $key => $username ) {
if ( $username == $user->user_login ) {
unset( $super_admins[$key] );
update_site_option( 'site_admins' , $super_admins );
do_action( 'revoked_super_admin', $user_id );
break;
}
}
}
update_site_option( 'site_admins' , $super_admins );
}
?>