Add an "Edit Site" submenu to the admin bar site menu when a super admin visits a blog dashboard. see #18188

git-svn-id: http://svn.automattic.com/wordpress/trunk@19855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-02-07 18:35:29 +00:00
parent afb70b3f36
commit 391fd02047
1 changed files with 10 additions and 2 deletions

View File

@ -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',