Permalink
Browse files

Update indicator for the Network Admin link. fixes #16063.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 82dd4d5 commit b61a5b0526454775c5ef0ec09fc4a6b3a241dedb nacin committed Jan 4, 2011
Showing with 11 additions and 6 deletions.
  1. +2 −2 wp-admin/admin-header.php
  2. +9 −4 wp-admin/menu.php
@@ -151,7 +151,7 @@
$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
if ( is_multisite() && is_super_admin() ) {
if ( !is_network_admin() )
- $links[10] = '| <a href="' . network_admin_url() . '" title="' . esc_attr__('Network Admin') . '">' . __('Network Admin') . '</a>';
+ $links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
else
$links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
}
@@ -170,7 +170,7 @@
<div id="wpbody">
<?php
-unset($title_class, $blog_name);
+unset($title_class, $blog_name, $total_update_count, $update_title);
require(ABSPATH . 'wp-admin/menu-header.php');
View
@@ -28,7 +28,9 @@
if ( is_multisite() ) {
$submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
-} else {
+}
+
+if ( ! is_multisite() || is_super_admin() ) {
$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
$update_plugins = get_site_transient( 'update_plugins' );
if ( !empty($update_plugins->response) )
@@ -40,7 +42,7 @@
if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
$wordpress_update_count = 1;
- $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
+ $total_update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
$update_title = array();
if ( $wordpress_update_count )
$update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
@@ -50,11 +52,14 @@
$update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
+}
- $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'update_core', 'update-core.php');
- unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
+if ( ! is_multisite() ) {
+ $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$total_update_count' title='$total_update_title'><span class='update-count'>" . number_format_i18n($total_update_count) . "</span></span>" ), 'update_core', 'update-core.php');
}
+unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
+
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );

0 comments on commit b61a5b0

Please sign in to comment.