diff --git a/wp-admin/menu.php b/wp-admin/menu.php index f6459c63ae..384516f3b8 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -50,20 +50,30 @@ if ( is_multisite() || is_super_admin() ) { $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' ); if ( is_super_admin() ) { - $update_count = 0; + $plugin_update_count = $theme_update_count = $wordpress_update_count = 0; $update_plugins = get_site_transient( 'update_plugins' ); if ( !empty($update_plugins->response) ) - $update_count += count( $update_plugins->response ); + $plugin_update_count = count( $update_plugins->response ); $update_themes = get_site_transient( 'update_themes' ); if ( !empty($update_themes->response) ) - $update_count += count( $update_themes->response ); + $theme_update_count = count( $update_themes->response ); $update_wordpress = get_core_updates( array('dismissed' => false) ); if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) ) - $update_count++; + $wordpress_update_count = 1; - unset($update_plugins, $update_themes, $update_wordpress); + $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); + if ( $plugin_update_count ) + $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count); + if ( $theme_update_count ) + $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count); - $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "" . number_format_i18n($update_count) . "" ), 'install_plugins', 'update-core.php'); + $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; + + $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "" . number_format_i18n($update_count) . "" ), 'install_plugins', 'update-core.php'); + unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title); } }