[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/network/ -> menu.php (source)

   1  <?php
   2  /**
   3   * Build Network Administration Menu.
   4   *
   5   * @package WordPress
   6   * @subpackage Multisite
   7   * @since 3.1.0
   8   */
   9  
  10  /* translators: Network menu item. */
  11  $menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
  12  
  13  $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
  14  
  15  if ( current_user_can( 'update_core' ) ) {
  16      $cap = 'update_core';
  17  } elseif ( current_user_can( 'update_plugins' ) ) {
  18      $cap = 'update_plugins';
  19  } elseif ( current_user_can( 'update_themes' ) ) {
  20      $cap = 'update_themes';
  21  } else {
  22      $cap = 'update_languages';
  23  }
  24  
  25  $update_data = wp_get_update_data();
  26  if ( $update_data['counts']['total'] ) {
  27      $submenu['index.php'][10] = array(
  28          sprintf(
  29              /* translators: %s: Number of available updates. */
  30              __( 'Updates %s' ),
  31              sprintf(
  32                  '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
  33                  $update_data['counts']['total'],
  34                  number_format_i18n( $update_data['counts']['total'] )
  35              )
  36          ),
  37          $cap,
  38          'update-core.php',
  39      );
  40  } else {
  41      $submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
  42  }
  43  
  44  unset( $cap );
  45  
  46  $submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );
  47  
  48  $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
  49  
  50  /* translators: Sites menu item. */
  51  $menu[5]                  = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );
  52  $submenu['sites.php'][5]  = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );
  53  $submenu['sites.php'][10] = array( __( 'Add New Site' ), 'create_sites', 'site-new.php' );
  54  
  55  $menu[10]                 = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
  56  $submenu['users.php'][5]  = array( __( 'All Users' ), 'manage_network_users', 'users.php' );
  57  $submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
  58  
  59  if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
  60      $menu[15] = array(
  61          sprintf(
  62              /* translators: %s: Number of available theme updates. */
  63              __( 'Themes %s' ),
  64              sprintf(
  65                  '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
  66                  $update_data['counts']['themes'],
  67                  number_format_i18n( $update_data['counts']['themes'] )
  68              )
  69          ),
  70          'manage_network_themes',
  71          'themes.php',
  72          '',
  73          'menu-top menu-icon-appearance',
  74          'menu-appearance',
  75          'dashicons-admin-appearance',
  76      );
  77  } else {
  78      $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
  79  }
  80  $submenu['themes.php'][5]  = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
  81  $submenu['themes.php'][10] = array( __( 'Add New Theme' ), 'install_themes', 'theme-install.php' );
  82  $submenu['themes.php'][15] = array( __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' );
  83  
  84  if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
  85      $menu[20] = array(
  86          sprintf(
  87              /* translators: %s: Number of available plugin updates. */
  88              __( 'Plugins %s' ),
  89              sprintf(
  90                  '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
  91                  $update_data['counts']['plugins'],
  92                  number_format_i18n( $update_data['counts']['plugins'] )
  93              )
  94          ),
  95          'manage_network_plugins',
  96          'plugins.php',
  97          '',
  98          'menu-top menu-icon-plugins',
  99          'menu-plugins',
 100          'dashicons-admin-plugins',
 101      );
 102  } else {
 103      $menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
 104  }
 105  $submenu['plugins.php'][5]  = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
 106  $submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' );
 107  $submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
 108  
 109  $menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
 110  if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
 111      $submenu['settings.php'][5]  = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
 112      $submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
 113  }
 114  unset( $update_data );
 115  
 116  $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
 117  
 118  require_once  ABSPATH . 'wp-admin/includes/menu.php';


Generated : Sun Dec 22 08:20:01 2024 Cross-referenced by PHPXref