Make WordPress Core

Changeset 39589


Ignore:
Timestamp:
12/12/2016 10:40:03 PM (8 years ago)
Author:
flixos90
Message:

Multisite: Replace is_super_admin() with manage_network in get_dashboard_url().

Unit tests for get_dashboard_url() have been added.

Props iaaxpage.
Fixes #39065. See #37616.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r39054 r39589  
    34733473
    34743474    $blogs = get_blogs_of_user( $user_id );
    3475     if ( ! is_super_admin() && empty($blogs) ) {
     3475    if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty($blogs) ) {
    34763476        $url = user_admin_url( $path, $scheme );
    34773477    } elseif ( ! is_multisite() ) {
     
    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 {
Note: See TracChangeset for help on using the changeset viewer.