Make WordPress Core

Ticket #39065: link-template.diff

File link-template.diff, 959 bytes (added by iaaxpage, 7 years ago)

Replaced is_super_admin with user_can($user_id, 'manage_network' )

  • wp-includes/link-template.php

     
    34723472        $user_id = $user_id ? (int) $user_id : get_current_user_id();
    34733473
    34743474        $blogs = get_blogs_of_user( $user_id );
    3475         if ( ! is_super_admin() && empty($blogs) ) {
     3475        if ( ! user_can($user_id, 'manage_network') && empty($blogs) ) {
    34763476                $url = user_admin_url( $path, $scheme );
    34773477        } elseif ( ! is_multisite() ) {
    34783478                $url = admin_url( $path, $scheme );
    34793479        } else {
    34803480                $current_blog = get_current_blog_id();
    3481                 if ( $current_blog  && ( is_super_admin( $user_id ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
     3481                if ( $current_blog  && ( user_can($user_id, 'manage_network') || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
    34823482                        $url = admin_url( $path, $scheme );
    34833483                } else {
    34843484                        $active = get_active_blog_for_user( $user_id );