mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 09:49:37 +01:00
16b8d91baa
* Add missing translator comments. * Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments. Includes minor code layout fixes. Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders! Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov. Fixes #44360. Built from https://develop.svn.wordpress.org/trunk@45926 git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
119 lines
4.6 KiB
PHP
119 lines
4.6 KiB
PHP
<?php
|
|
/**
|
|
* Build Network Administration Menu.
|
|
*
|
|
* @package WordPress
|
|
* @subpackage Multisite
|
|
* @since 3.1.0
|
|
*/
|
|
|
|
/* translators: Network menu item */
|
|
$menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
|
|
|
|
$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
|
|
|
|
if ( current_user_can( 'update_core' ) ) {
|
|
$cap = 'update_core';
|
|
} elseif ( current_user_can( 'update_plugins' ) ) {
|
|
$cap = 'update_plugins';
|
|
} elseif ( current_user_can( 'update_themes' ) ) {
|
|
$cap = 'update_themes';
|
|
} else {
|
|
$cap = 'update_languages';
|
|
}
|
|
|
|
$update_data = wp_get_update_data();
|
|
if ( $update_data['counts']['total'] ) {
|
|
$submenu['index.php'][10] = array(
|
|
sprintf(
|
|
/* translators: %s: number of available updates */
|
|
__( 'Updates %s' ),
|
|
sprintf(
|
|
'<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
|
|
$update_data['counts']['total'],
|
|
number_format_i18n( $update_data['counts']['total'] )
|
|
)
|
|
),
|
|
$cap,
|
|
'update-core.php',
|
|
);
|
|
} else {
|
|
$submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
|
|
}
|
|
|
|
unset( $cap );
|
|
|
|
$submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );
|
|
|
|
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
|
|
|
|
/* translators: Sites menu item */
|
|
$menu[5] = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );
|
|
$submenu['sites.php'][5] = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );
|
|
$submenu['sites.php'][10] = array( _x( 'Add New', 'site' ), 'create_sites', 'site-new.php' );
|
|
|
|
$menu[10] = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
|
|
$submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'users.php' );
|
|
$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );
|
|
|
|
if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
|
|
$menu[15] = array(
|
|
sprintf(
|
|
/* translators: %s: number of available theme updates */
|
|
__( 'Themes %s' ),
|
|
sprintf(
|
|
'<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
|
|
$update_data['counts']['themes'],
|
|
number_format_i18n( $update_data['counts']['themes'] )
|
|
)
|
|
),
|
|
'manage_network_themes',
|
|
'themes.php',
|
|
'',
|
|
'menu-top menu-icon-appearance',
|
|
'menu-appearance',
|
|
'dashicons-admin-appearance',
|
|
);
|
|
} else {
|
|
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
|
|
}
|
|
$submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
|
|
$submenu['themes.php'][10] = array( _x( 'Add New', 'theme' ), 'install_themes', 'theme-install.php' );
|
|
$submenu['themes.php'][15] = array( __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
|
|
|
|
if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
|
|
$menu[20] = array(
|
|
sprintf(
|
|
/* translators: %s: number of available plugin updates */
|
|
__( 'Plugins %s' ),
|
|
sprintf(
|
|
'<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
|
|
$update_data['counts']['plugins'],
|
|
number_format_i18n( $update_data['counts']['plugins'] )
|
|
)
|
|
),
|
|
'manage_network_plugins',
|
|
'plugins.php',
|
|
'',
|
|
'menu-top menu-icon-plugins',
|
|
'menu-plugins',
|
|
'dashicons-admin-plugins',
|
|
);
|
|
} else {
|
|
$menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
|
|
}
|
|
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
|
|
$submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );
|
|
$submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );
|
|
|
|
$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
|
|
if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
|
|
$submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
|
|
$submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
|
|
}
|
|
unset( $update_data );
|
|
|
|
$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
|
|
|
|
require_once( ABSPATH . 'wp-admin/includes/menu.php' );
|