WordPress.org

Make WordPress Core

Ticket #21120: 21120.5.diff

File 21120.5.diff, 634 bytes (added by SergeyBiryukov, 6 years ago)
  • wp-includes/capabilities.php

     
    14231423 * @return bool True if the user is a site admin.
    14241424 */
    14251425function is_super_admin( $user_id = false ) {
    1426         if ( ! $user_id )
    1427                 $user_id = get_current_user_id();
     1426        if ( ! $user_id || get_current_user_id() == $user_id )
     1427                $user = wp_get_current_user();
     1428        else
     1429                $user = get_userdata( $user_id );
    14281430
    1429         if ( ! $user = get_userdata( $user_id ) )
     1431        if ( ! $user )
    14301432                return false;
    14311433
    14321434        if ( is_multisite() ) {