X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-admin/menu.php diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 89c13d96..17096a97 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -18,8 +18,6 @@ * 5: Icon for top level menu * * @global array $menu - * @name $menu - * @var array */ $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); @@ -147,24 +145,24 @@ $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options'; -$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); +$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' ); $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' ); - $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', $customize_url, '', 'hide-if-no-customize' ); + $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { - $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); + $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); } if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize') ) { - $customize_header_url = add_query_arg( 'autofocus[control]', 'header_image', $customize_url ); - $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' ); + $customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url ); + $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize') ) { - $customize_background_url = add_query_arg( 'autofocus[control]', 'background_image', $customize_url ); - $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' ); + $customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url ); + $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' ); } unset( $customize_url ); @@ -172,8 +170,12 @@ $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-to unset( $appearance_cap ); // Add 'Editor' to the bottom of the Appearance menu. -if ( ! is_multisite() ) +if ( ! is_multisite() ) { add_action('admin_menu', '_add_themes_utility_last', 101); +} +/** + * + */ function _add_themes_utility_last() { // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php'); @@ -228,7 +230,7 @@ $menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-ic $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); $submenu['tools.php'][15] = array( __('Export'), 'export', 'export.php' ); if ( is_multisite() && !is_main_site() ) - $submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' ); + $submenu['tools.php'][25] = array( __('Delete Site'), 'delete_site', 'ms-delete-site.php' ); if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE ) $submenu['tools.php'][50] = array(__('Network Setup'), 'manage_options', 'network.php');