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:
parent
9826fcb06b
commit
6eaa3b9637
|
@ -831,18 +831,18 @@ function revoke_super_admin( $user_id ) {
|
||||||
do_action( 'revoke_super_admin', $user_id );
|
do_action( 'revoke_super_admin', $user_id );
|
||||||
|
|
||||||
$admin_email = get_site_option( 'admin_email' );
|
$admin_email = get_site_option( 'admin_email' );
|
||||||
|
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
|
||||||
|
|
||||||
$user = new WP_User( $user_id );
|
$user = new WP_User( $user_id );
|
||||||
if ( $user->user_email != $admin_email ) {
|
if ( $user->user_email != $admin_email ) {
|
||||||
foreach ( $super_admins as $key => $username ) {
|
foreach ( $super_admins as $key => $username ) {
|
||||||
if ( $username == $user->user_login ) {
|
if ( $username == $user->user_login ) {
|
||||||
unset( $super_admins[$key] );
|
unset( $super_admins[$key] );
|
||||||
|
update_site_option( 'site_admins' , $super_admins );
|
||||||
do_action( 'revoked_super_admin', $user_id );
|
do_action( 'revoked_super_admin', $user_id );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_site_option( 'site_admins' , $super_admins );
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue