diff --git a/wp-admin/my-sites.php b/wp-admin/my-sites.php
index a082c2bb16..e07ce7760a 100644
--- a/wp-admin/my-sites.php
+++ b/wp-admin/my-sites.php
@@ -108,20 +108,33 @@ else :
reset( $blogs );
foreach ( $blogs as $user_blog ) {
+ switch_to_blog( $user_blog->userblog_id );
+
echo "
";
echo "{$user_blog->blogname}
";
+
+ $actions = "" . __( 'Visit' ) . '';
+
+ if ( current_user_can( 'read' ) ) {
+ $actions .= " | " . __( 'Dashboard' ) . '';
+ }
+
/**
* Filters the row links displayed for each site on the My Sites screen.
*
* @since MU (3.0.0)
*
- * @param string $string The HTML site link markup.
+ * @param string $actions The HTML site link markup.
* @param object $user_blog An object containing the site data.
*/
- echo "" . apply_filters( 'myblogs_blog_actions', "" . __( 'Visit' ) . " | " . __( 'Dashboard' ) . "", $user_blog ) . "
";
+ $actions = apply_filters( 'myblogs_blog_actions', $actions, $user_blog );
+ echo "" . $actions . '
';
+
/** This filter is documented in wp-admin/my-sites.php */
echo apply_filters( 'myblogs_options', '', $user_blog );
echo "";
+
+ restore_current_blog();
}?>
userblog_id;
- $wp_admin_bar->add_menu( array(
- 'parent' => 'my-sites-list',
- 'id' => $menu_id,
- 'title' => $blavatar . $blogname,
- 'href' => admin_url(),
- ) );
+ if ( current_user_can( 'read' ) ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'my-sites-list',
+ 'id' => $menu_id,
+ 'title' => $blavatar . $blogname,
+ 'href' => admin_url(),
+ ) );
- $wp_admin_bar->add_menu( array(
- 'parent' => $menu_id,
- 'id' => $menu_id . '-d',
- 'title' => __( 'Dashboard' ),
- 'href' => admin_url(),
- ) );
+ $wp_admin_bar->add_menu( array(
+ 'parent' => $menu_id,
+ 'id' => $menu_id . '-d',
+ 'title' => __( 'Dashboard' ),
+ 'href' => admin_url(),
+ ) );
+ } else {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'my-sites-list',
+ 'id' => $menu_id,
+ 'title' => $blavatar . $blogname,
+ 'href' => home_url(),
+ ) );
+ }
if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
$wp_admin_bar->add_menu( array(
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 7612a28e8b..eddad65fe4 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.9-beta1-41795';
+$wp_version = '4.9-beta1-41796';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.