Make WordPress Core

Changeset 39492


Ignore:
Timestamp:
12/04/2016 09:20:44 PM (10 years ago)
Author:
flixos90
Message:

Multisite: Replace is_super_admin() with manage_network for admin bar permissions.

Props iaaxpage.
Fixes #39064. See #37616.

File:
1 edited

Legend:

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

    r38814 r39492  
    302302
    303303        // Show only when the user is a member of this site, or they're a super admin.
    304         if ( ! is_user_member_of_blog() && ! is_super_admin() )
    305                 return;
     304        if ( ! is_user_member_of_blog() && ! current_user_can( 'manage_network' ) ) {
     305                return;
     306        }
    306307
    307308        $blogname = get_bloginfo('name');
    … …  
    416417
    417418        // Show only when the user has at least one site, or they're a super admin.
    418         if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() )
    419                 return;
     419        if ( count( $wp_admin_bar->user->blogs ) < 1 && ! current_user_can( 'manage_network' ) ) {
     420                return;
     421        }
    420422
    421423        if ( $wp_admin_bar->user->active_blog ) {
    … …  
    431433        ) );
    432434
    433         if ( is_super_admin() ) {
     435        if ( current_user_can( 'manage_network' ) ) {
    434436                $wp_admin_bar->add_group( array(
    435437                        'parent' => 'my-sites',
    … …  
    487489                'id'     => 'my-sites-list',
    488490                'meta'   => array(
    489                         'class' => is_super_admin() ? 'ab-sub-secondary' : '',
     491                        'class' => current_user_can( 'manage_network' ) ? 'ab-sub-secondary' : '',
    490492                ),
    491493        ) );
Note: See TracChangeset for help on using the changeset viewer.