menu.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Build Network Administration Menu.
  4. *
  5. * @package WordPress
  6. * @subpackage Multisite
  7. * @since 3.1.0
  8. */
  9. /* translators: Network menu item */
  10. $menu[2] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard');
  11. $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
  12. $update_data = wp_get_update_data();
  13. if ( $update_data['counts']['total'] ) {
  14. $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . "</span></span>" ), 'update_core', 'update-core.php' );
  15. } else {
  16. $submenu['index.php'][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' );
  17. }
  18. $submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'manage_network', 'upgrade.php' );
  19. $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
  20. /* translators: Sites menu item */
  21. $menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite');
  22. $submenu['sites.php'][5] = array( __('All Sites'), 'manage_sites', 'sites.php' );
  23. $submenu['sites.php'][10] = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
  24. $menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users');
  25. $submenu['users.php'][5] = array( __('All Users'), 'manage_network_users', 'users.php' );
  26. $submenu['users.php'][10] = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
  27. if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
  28. $menu[15] = array(sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
  29. } else {
  30. $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
  31. }
  32. $submenu['themes.php'][5] = array( __('Installed Themes'), 'manage_network_themes', 'themes.php' );
  33. $submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
  34. $submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
  35. if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
  36. $menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins');
  37. } else {
  38. $menu[20] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
  39. }
  40. $submenu['plugins.php'][5] = array( __('Installed Plugins'), 'manage_network_plugins', 'plugins.php' );
  41. $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
  42. $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
  43. $menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings');
  44. if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
  45. $submenu['settings.php'][5] = array( __('Network Settings'), 'manage_network_options', 'settings.php' );
  46. $submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
  47. }
  48. unset($update_data);
  49. $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
  50. require_once(ABSPATH . 'wp-admin/includes/menu.php');