From 9805be9f11282ed86293ee5ef14208e5186bf88a Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 6 May 2007 20:36:11 +0000 Subject: [PATCH] Make sure Widgets menu comes after Themes. see #4169 git-svn-id: http://svn.automattic.com/wordpress/trunk@5401 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.php | 2 ++ wp-includes/functions.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 383abeb79..7bd8bc943 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -69,6 +69,8 @@ $submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); +do_action('_admin_menu'); + // Create list of page plugin hook names. foreach ($menu as $menu_page) { $admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1a1651cc1..97cb86af8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1506,13 +1506,14 @@ function wp_parse_args( $args, $defaults = '' ) { function wp_maybe_load_widgets() { if ( !function_exists( 'dynamic_sidebar' ) ) { require_once ABSPATH . WPINC . '/widgets.php'; - add_action( 'admin_head', 'wp_widgets_admin_page' ); + add_action( '_admin_menu', 'wp_widgets_add_menu' ); } } -function wp_widgets_admin_page() { +function wp_widgets_add_menu() { global $submenu; $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_themes', 'widgets.php' ); + ksort($submenu['themes.php'], SORT_NUMERIC); } ?> \ No newline at end of file