Make WordPress Core

Changeset 17217


Ignore:
Timestamp:
01/04/2011 08:36:06 AM (15 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r17016 r17217  
    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>';
     
    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');
  • trunk/wp-admin/menu.php

    r17048 r17217  
    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' );
     
    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 )
     
    5153
    5254    $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
    53 
    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);
    56 }
     55}
     56
     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');
     59}
     60
     61unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
    5762
    5863$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
Note: See TracChangeset for help on using the changeset viewer.