2010-07-30 16:34:54 -04:00
|
|
|
<?php
|
2010-10-21 07:21:13 -04:00
|
|
|
/**
|
|
|
|
* Build Network Administration Menu.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
2010-11-10 09:27:15 -05:00
|
|
|
* @subpackage Multisite
|
2010-10-21 07:21:13 -04:00
|
|
|
* @since 3.1.0
|
|
|
|
*/
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
/* translators: Network menu item */
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[2] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard');
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
|
|
|
|
|
|
|
|
/* translators: Sites menu item */
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-network');
|
2011-05-24 17:58:01 -04:00
|
|
|
$submenu['sites.php'][5] = array( __('All Sites'), 'manage_sites', 'sites.php' );
|
2010-11-29 11:41:35 -05:00
|
|
|
$submenu['sites.php'][10] = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
|
2010-10-21 09:49:49 -04:00
|
|
|
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users');
|
2011-05-24 17:58:01 -04:00
|
|
|
$submenu['users.php'][5] = array( __('All Users'), 'manage_network_users', 'users.php' );
|
2010-11-29 11:41:35 -05:00
|
|
|
$submenu['users.php'][10] = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
|
2010-10-21 13:06:52 -04:00
|
|
|
|
2011-07-26 14:39:57 -04:00
|
|
|
$update_data = wp_get_update_data();
|
|
|
|
|
|
|
|
if ( $update_data['counts']['themes'] ) {
|
2014-03-06 17:52:15 -05:00
|
|
|
$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' );
|
2011-05-06 15:48:13 -04:00
|
|
|
} else {
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
|
2011-05-06 15:48:13 -04:00
|
|
|
}
|
2011-05-24 17:58:01 -04:00
|
|
|
$submenu['themes.php'][5] = array( __('Installed Themes'), 'manage_network_themes', 'themes.php' );
|
2010-11-12 10:32:40 -05:00
|
|
|
$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
|
2010-10-21 13:06:52 -04:00
|
|
|
$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
|
2010-10-20 10:16:03 -04:00
|
|
|
|
2011-05-06 15:48:13 -04:00
|
|
|
if ( current_user_can( 'update_plugins' ) ) {
|
2014-03-06 17:52:15 -05:00
|
|
|
$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');
|
2011-05-06 15:48:13 -04:00
|
|
|
} else {
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[20] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
|
2011-05-06 15:48:13 -04:00
|
|
|
}
|
2011-05-24 17:58:01 -04:00
|
|
|
$submenu['plugins.php'][5] = array( __('Installed Plugins'), 'manage_network_plugins', 'plugins.php' );
|
2012-09-15 15:57:46 -04:00
|
|
|
$submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
|
2010-10-20 10:16:03 -04:00
|
|
|
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
|
|
|
|
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings');
|
2010-11-18 00:24:13 -05:00
|
|
|
if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
|
2011-05-24 17:58:01 -04:00
|
|
|
$submenu['settings.php'][5] = array( __('Network Settings'), 'manage_network_options', 'settings.php' );
|
2010-11-18 00:24:13 -05:00
|
|
|
$submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
|
|
|
|
}
|
2010-10-20 12:38:00 -04:00
|
|
|
|
2011-07-26 14:39:57 -04:00
|
|
|
if ( $update_data['counts']['total'] ) {
|
2014-03-06 17:52:15 -05:00
|
|
|
$menu[30] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'dashicons-admin-tools' );
|
2011-05-06 15:48:13 -04:00
|
|
|
} else {
|
2014-03-05 15:04:14 -05:00
|
|
|
$menu[30] = array( __( 'Updates' ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'dashicons-admin-tools' );
|
2011-05-06 15:48:13 -04:00
|
|
|
}
|
2010-10-20 12:38:00 -04:00
|
|
|
|
2011-07-26 14:39:57 -04:00
|
|
|
unset($update_data);
|
|
|
|
|
2011-12-14 12:36:38 -05:00
|
|
|
$submenu[ 'upgrade.php' ][10] = array( __( 'Available Updates' ), 'update_core', 'update-core.php' );
|
2013-03-05 12:02:31 -05:00
|
|
|
$submenu[ 'upgrade.php' ][15] = array( __( 'Upgrade Network' ), 'manage_network', 'upgrade.php' );
|
2010-07-30 16:34:54 -04:00
|
|
|
|
2014-02-02 01:19:12 -05:00
|
|
|
$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
|
2010-07-30 16:34:54 -04:00
|
|
|
|
2010-10-04 15:25:39 -04:00
|
|
|
require_once(ABSPATH . 'wp-admin/includes/menu.php');
|