Make WordPress Core

Ticket #14435: 14435.18.diff

File 14435.18.diff, 2.0 KB (added by PeteMall, 13 years ago)

Add theme update notification to net admin menus.

  • wp-admin/network/menu.php

     
    2121$submenu['users.php'][5]  = array( __('Users'), 'manage_network_users', 'users.php' );
    2222$submenu['users.php'][10]  = array( __('Add New'), '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='plugin-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) )
    3235        $plugin_update_count = count( $update_plugins->response );
     
    4245        $submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
    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') ) )
    5050        $wordpress_update_count = 1;