WordPress.org

Make WordPress Core

Ticket #16063: 16063.number.diff

File 16063.number.diff, 3.4 KB (added by nacin, 7 years ago)
  • wp-admin/menu.php

     
    2828
    2929if ( is_multisite() ) {
    3030        $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
    31 } else {
     31}
     32
     33if ( ! is_multisite() || is_super_admin() ) {
    3234        $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
    3335        $update_plugins = get_site_transient( 'update_plugins' );
    3436        if ( !empty($update_plugins->response) )
     
    4042        if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
    4143                $wordpress_update_count = 1;
    4244
    43         $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
     45        $total_update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
    4446        $update_title = array();
    4547        if ( $wordpress_update_count )
    4648                $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
     
    5052                $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
    5153
    5254        $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
     55}
    5356
    54         $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');
    55         unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
     57if ( ! is_multisite() ) {
     58        $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');
    5659}
    5760
     61unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
     62
    5863$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
    5964
    6065$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );
  • wp-admin/admin-header.php

     
    151151$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
    152152if ( is_multisite() && is_super_admin() ) {
    153153        if ( !is_network_admin() )
    154                 $links[10] = '| <a href="' . network_admin_url() . '" title="' . esc_attr__('Network Admin') . '">' . __('Network Admin') . '</a>';
     154                $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>';
    155155        else
    156156                $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
    157157}
     
    170170
    171171<div id="wpbody">
    172172<?php
    173 unset($title_class, $blog_name);
     173unset($title_class, $blog_name, $total_update_count, $update_title);
    174174
    175175require(ABSPATH . 'wp-admin/menu-header.php');
    176176