WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/17/2010 06:51:19 PM (9 years ago)
Author:
nacin
Message:

Add theme update bubble, hide redundant bubble on network admin. props PeteMall, see #15866.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/menu.php

    r16611 r17029  
    2222$submenu['users.php'][10]  = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
    2323
    24 $menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
     24$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
     25$update_themes = get_site_transient( 'update_themes' );
     26if ( !empty($update_themes->response) )
     27    $theme_update_count = count( $update_themes->response );
     28$menu[15] = array(sprintf(__('Themes %s'), "<span class='update-plugins count-$theme_update_count'><span class='theme-count'>" . number_format_i18n($theme_update_count) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
    2529$submenu['themes.php'][5]  = array( __('Themes'), 'manage_network_themes', 'themes.php' );
    2630$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
    2731$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
    2832
    29 $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
    3033$update_plugins = get_site_transient( 'update_plugins' );
    3134if ( !empty($update_plugins->response) )
     
    4346}
    4447
    45 $update_themes = get_site_transient( 'update_themes' );
    46 if ( !empty($update_themes->response) )
    47     $theme_update_count = count( $update_themes->response );
    4848$update_wordpress = get_core_updates( array('dismissed' => false) );
    4949if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
     
    6262
    6363$menu[30] = 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>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
    64 $submenu[ 'upgrade.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>" ), 'install_plugins',  'update-core.php');
     64$submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), 'install_plugins',  'update-core.php' );
    6565$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
    6666unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
Note: See TracChangeset for help on using the changeset viewer.