WordPress.org

Make WordPress Core

Ticket #15129: 15129.diff

File 15129.diff, 1.4 KB (added by PeteMall, 5 years ago)

First pass: Add plugin update notification to Network Admin screen.

  • network/menu.php

     
    99$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div'); 
    1010$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div'); 
    1111$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div'); 
    12 $menu[20] = array(__('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div'); 
     12 
     13$plugin_update_count = 0; 
     14$update_plugins = get_site_transient( 'update_plugins' ); 
     15if ( !empty($update_plugins->response) ) 
     16        $plugin_update_count = count( $update_plugins->response ); 
     17 
     18$menu[20] = array(sprintf( __('Plugins %s'), "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div'); 
    1319$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div'); 
    1420$menu[30] = array(__('Update'), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div'); 
    1521