@@ 673-686 (lines=14) @@ | ||
670 | $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); |
|
671 | ||
672 | $user = get_userdata( $user_id ); |
|
673 | if ( $user && ! in_array( $user->user_login, $super_admins ) ) { |
|
674 | $super_admins[] = $user->user_login; |
|
675 | update_site_option( 'site_admins' , $super_admins ); |
|
676 | ||
677 | /** |
|
678 | * Fires after the user is granted Super Admin privileges. |
|
679 | * |
|
680 | * @since 3.0.0 |
|
681 | * |
|
682 | * @param int $user_id ID of the user that was granted Super Admin privileges. |
|
683 | */ |
|
684 | do_action( 'granted_super_admin', $user_id ); |
|
685 | return true; |
|
686 | } |
|
687 | return false; |
|
688 | } |
|
689 | ||
@@ 721-734 (lines=14) @@ | ||
718 | ||
719 | $user = get_userdata( $user_id ); |
|
720 | if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) { |
|
721 | if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { |
|
722 | unset( $super_admins[$key] ); |
|
723 | update_site_option( 'site_admins', $super_admins ); |
|
724 | ||
725 | /** |
|
726 | * Fires after the user's Super Admin privileges are revoked. |
|
727 | * |
|
728 | * @since 3.0.0 |
|
729 | * |
|
730 | * @param int $user_id ID of the user Super Admin privileges were revoked from. |
|
731 | */ |
|
732 | do_action( 'revoked_super_admin', $user_id ); |
|
733 | return true; |
|
734 | } |
|
735 | } |
|
736 | return false; |
|
737 | } |