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
|
|
|
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: Network menu item. */
|
2017-11-30 18:11:00 -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
|
|
|
|
2015-05-19 13:00:29 -04:00
|
|
|
$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
|
|
|
|
|
2017-08-19 06:39:44 -04:00
|
|
|
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';
|
|
|
|
}
|
|
|
|
|
2015-05-19 13:00:29 -04:00
|
|
|
$update_data = wp_get_update_data();
|
|
|
|
if ( $update_data['counts']['total'] ) {
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
$submenu['index.php'][10] = array(
|
|
|
|
sprintf(
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: %s: Number of available updates. */
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
__( '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',
|
|
|
|
);
|
2015-05-19 13:00:29 -04:00
|
|
|
} else {
|
2017-08-19 06:39:44 -04:00
|
|
|
$submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
|
2015-05-19 13:00:29 -04:00
|
|
|
}
|
|
|
|
|
2017-08-19 06:39:44 -04:00
|
|
|
unset( $cap );
|
|
|
|
|
2017-04-10 17:11:43 -04:00
|
|
|
$submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );
|
2015-05-19 13:00:29 -04:00
|
|
|
|
2010-07-30 16:34:54 -04:00
|
|
|
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
|
|
|
|
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: Sites menu item. */
|
2017-11-30 18:11:00 -05:00
|
|
|
$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' );
|
2023-09-05 15:26:26 -04:00
|
|
|
$submenu['sites.php'][10] = array( __( 'Add New Site' ), 'create_sites', 'site-new.php' );
|
2010-10-21 09:49:49 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
$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' );
|
2023-09-05 15:26:26 -04:00
|
|
|
$submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
|
2010-10-21 13:06:52 -04:00
|
|
|
|
2014-10-02 11:49:17 -04:00
|
|
|
if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
$menu[15] = array(
|
|
|
|
sprintf(
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: %s: Number of available theme updates. */
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
__( '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',
|
|
|
|
);
|
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
|
|
|
}
|
2017-11-30 18:11:00 -05:00
|
|
|
$submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
|
2023-09-05 15:26:26 -04:00
|
|
|
$submenu['themes.php'][10] = array( __( 'Add New Theme' ), 'install_themes', 'theme-install.php' );
|
Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin Editor menu item from Plugins to Tools for block themes for a consistent workflow.
Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes.
Follow-up to [52232].
Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406
git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 15:06:02 -05:00
|
|
|
$submenu['themes.php'][15] = array( __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' );
|
2010-10-20 10:16:03 -04:00
|
|
|
|
2014-10-02 11:49:17 -04:00
|
|
|
if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
$menu[20] = array(
|
|
|
|
sprintf(
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: %s: Number of available plugin updates. */
|
I18N: Improve translator comments.
* 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
2019-09-01 13:13:59 -04:00
|
|
|
__( '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',
|
|
|
|
);
|
2011-05-06 15:48:13 -04:00
|
|
|
} else {
|
2017-11-30 18:11:00 -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
|
|
|
}
|
2017-11-30 18:11:00 -05:00
|
|
|
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
|
2023-09-05 15:26:26 -04:00
|
|
|
$submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' );
|
Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin Editor menu item from Plugins to Tools for block themes for a consistent workflow.
Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes.
Follow-up to [52232].
Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406
git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 15:06:02 -05:00
|
|
|
$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
|
2010-10-20 10:16:03 -04:00
|
|
|
|
2017-11-30 18:11:00 -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 ) {
|
2017-11-30 18:11:00 -05:00
|
|
|
$submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
|
|
|
|
$submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
|
2010-11-18 00:24:13 -05:00
|
|
|
}
|
2017-11-30 18:11:00 -05:00
|
|
|
unset( $update_data );
|
2011-07-26 14:39:57 -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
|
|
|
|
2020-02-06 01:33:11 -05:00
|
|
|
require_once ABSPATH . 'wp-admin/includes/menu.php';
|