WordPress.org

Make WordPress Core

Ticket #15866: 15866.diff

File 15866.diff, 3.0 KB (added by PeteMall, 3 years ago)
  • wp-admin/network/menu.php

     
    2121$submenu['users.php'][5]  = array( __('Users'), 'manage_network_users', 'users.php' ); 
    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) ) 
    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; 
     
    6161$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; 
    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); 
    6767