WordPress.org

Make WordPress Core

Ticket #18470: 18470.diff

File 18470.diff, 1.4 KB (added by PeteMall, 7 years ago)
  • wp-admin/user-edit.php

     
    130130        if ( $delete_role ) // stops users being added to current blog when they are edited
    131131                delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
    132132
    133         if ( is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
     133        if ( is_multisite() && is_network_admin() && ( ! IS_PROFILE_PAGE || count( get_super_admins() ) > 1 ) && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
    134134                empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
    135135}
    136136
     
    259259</select>
    260260<?php endif; //!IS_PROFILE_PAGE
    261261
    262 if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
     262if ( is_multisite() && is_network_admin() && ( ! IS_PROFILE_PAGE || count( get_super_admins() ) > 1 ) && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
    263263<tr><th><label for="role"><?php _e('Super Admin'); ?></label></th>
    264264<td>
    265265<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?>