WordPress.org

Make WordPress Core

Ticket #19122: 19122.diff

File 19122.diff, 1.5 KB (added by duck_, 7 years ago)
  • wp-includes/admin-bar.php

     
    226226function wp_admin_bar_site_menu( $wp_admin_bar ) {
    227227        global $current_site;
    228228
    229         if ( ! is_user_logged_in() )
     229        if ( ! is_user_logged_in() || ! array_key_exists( get_current_blog_id(), $wp_admin_bar->user->blogs ) && ! is_super_admin() )
    230230                return;
    231231
    232232        $blogname = get_bloginfo('name');
     
    288288        if ( ! is_user_logged_in() || ! is_multisite() )
    289289                return;
    290290
    291         // Show only when there are more than two items in the menu.
    292         if ( count( $wp_admin_bar->user->blogs ) <= 1 && ! is_super_admin() )
    293                 return;
    294 
    295291        $wp_admin_bar->add_menu( array(
    296292                'id'    => 'my-sites',
    297293                'title' => __( 'My Sites' ),
     
    347343        $blue_wp_logo_url = includes_url('images/wpmini-blue.png');
    348344
    349345        foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
    350                 // Skip the current blog (unless we're in the network/user admin).
    351                 if ( $blog->userblog_id == get_current_blog_id() && ! is_network_admin() && ! is_user_admin() ) {
    352                         continue;
    353                 }
    354 
    355346                // @todo Replace with some favicon lookup.
    356347                //$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $blue_wp_logo_url ) ) . '" alt="Blavatar" width="16" height="16" />';
    357348                $blavatar = '<img src="' . esc_url($blue_wp_logo_url) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';