Make WordPress Core


Ignore:
Timestamp:
10/19/2025 05:40:13 PM (3 months ago)
Author:
johnjamesjacoby
Message:

Networks and Sites: remove email address check when attempting to demote a Super Admin.

This change ensures that a capable Super Admin is allowed to manage global Users as intended, and removes an invisible & undocumented restriction (that was easily bypassed anyways).

It also adds 1 multisite unit test to confirm the intended behavior

Props flixos90, johnjamesjacoby, Mista-Flo.

Fixes #39170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r60491 r60977  
    12531253 *
    12541254 * @since 3.0.0
     1255 * @since 6.9.0 Super admin privileges can be revoked regardless of email address.
    12551256 *
    12561257 * @global array $super_admins
     
    12791280
    12801281    $user = get_userdata( $user_id );
    1281     if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {
     1282    if ( $user ) {
    12821283        $key = array_search( $user->user_login, $super_admins, true );
    12831284        if ( false !== $key ) {
Note: See TracChangeset for help on using the changeset viewer.