diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index f35125ec68..80d817fbce 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -329,10 +329,16 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() ) 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' ); + } else { + $my_sites_url = admin_url( 'my-sites.php' ); + } + $wp_admin_bar->add_menu( array( 'id' => 'my-sites', 'title' => __( 'My Sites' ), - 'href' => get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' ), + 'href' => $my_sites_url, ) ); if ( is_super_admin() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 54239ffd4c..6a43fbd1a7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta3-31980'; +$wp_version = '4.2-beta3-31981'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.