From 975135c1d1642b91929336539cc5bea8fd041559 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 7 Feb 2012 18:35:29 +0000 Subject: [PATCH] Add an "Edit Site" submenu to the admin bar site menu when a super admin visits a blog dashboard. see #18188 git-svn-id: https://develop.svn.wordpress.org/trunk@19855 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/admin-bar.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 5aacd79734..41800c5707 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -248,9 +248,17 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { 'href' => home_url( '/' ), ) ); - // We're on the front end, print a copy of the admin menu. + if ( is_blog_admin() && is_multisite() && current_user_can( 'manage_sites' ) ) { + $wp_admin_bar->add_menu( array( + 'parent' => 'site-name', + 'id' => 'edit-site', + 'title' => __( 'Edit Site' ), + 'href' => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ), + ) ); + } + } else { - // Add the dashboard item. + // We're on the front end, link to the Dashboard. $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'dashboard',