WordPress.org

Make WordPress Core

Ticket #15923: 15923.2.patch

File 15923.2.patch, 1.3 KB (added by SergeyBiryukov, 7 years ago)
  • wp-includes/admin-bar.php

     
    9999 * @since 3.1.0
    100100 */
    101101function wp_admin_bar_my_sites_menu() {
    102         global $wpdb, $wp_admin_bar;
     102        global $wpdb, $wp_admin_bar, $blog_id;
    103103
    104104        /* Add the 'My Sites' menu if the user has more than one site. */
    105105        if ( count( $wp_admin_bar->user->blogs ) <= 1 )
     
    126126                        $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) );
    127127                }
    128128
    129                 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id) ) );
     129                if ( is_admin() || get_home_url($blog->userblog_id) != get_home_url($blog_id) )
     130                        $home_url_title = __( 'Visit Site' );
     131                else
     132                        $home_url_title = __( 'Visit Home Page' );
     133                $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => $home_url_title, 'href' => get_home_url($blog->userblog_id) ) );
    130134        }
    131135}
    132136