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

Props iaaxpage.
Fixes #39064. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2016-12-04 21:20:44 +00:00
parent bc6b164d23
commit 40668a1c63
1 changed files with 6 additions and 4 deletions

View File

@ -301,8 +301,9 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
return;
// Show only when the user is a member of this site, or they're a super admin.
if ( ! is_user_member_of_blog() && ! is_super_admin() )
if ( ! is_user_member_of_blog() && ! current_user_can( 'manage_network' ) ) {
return;
}
$blogname = get_bloginfo('name');
@ -415,8 +416,9 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
return;
// Show only when the user has at least one site, or they're a super admin.
if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() )
if ( count( $wp_admin_bar->user->blogs ) < 1 && ! current_user_can( 'manage_network' ) ) {
return;
}
if ( $wp_admin_bar->user->active_blog ) {
$my_sites_url = get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' );
@ -430,7 +432,7 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
'href' => $my_sites_url,
) );
if ( is_super_admin() ) {
if ( current_user_can( 'manage_network' ) ) {
$wp_admin_bar->add_group( array(
'parent' => 'my-sites',
'id' => 'my-sites-super-admin',
@ -486,7 +488,7 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
'parent' => 'my-sites',
'id' => 'my-sites-list',
'meta' => array(
'class' => is_super_admin() ? 'ab-sub-secondary' : '',
'class' => current_user_can( 'manage_network' ) ? 'ab-sub-secondary' : '',
),
) );