Fix revoke_super_admin(). see #12933.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-04-09 07:17:42 +00:00
parent 9826fcb06b
commit 6eaa3b9637

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 );
}
?>