diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 4e09015830..383abeb799 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -67,7 +67,6 @@ $submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.p $submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php'); $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); -$submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); // Create list of page plugin hook names. diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 68e73cb13e..e163cd7978 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1506,6 +1506,10 @@ function wp_parse_args( $args, $defaults = '' ) { function wp_maybe_load_widgets() { if ( !function_exists( 'dynamic_sidebar' ) ) { require_once ABSPATH . WPINC . '/widgets.php'; + + if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false && isset( $GLOBALS['submenu'] ) ) { + $GLOBALS['submenu']['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); + } } }