From 5cef2ca0a610c0c4c31caf2d4947c03fe0acd101 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 11 Nov 2010 19:11:12 +0000 Subject: [PATCH] Register admin menus against admin_bar_menu action to be consistent with other menu hooks. see #14772 git-svn-id: http://svn.automattic.com/wordpress/trunk@16309 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 2 ++ wp-includes/class-wp-admin-bar.php | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 209dbce87..f4a18a9c5 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -53,6 +53,8 @@ function wp_admin_bar_render() { $wp_admin_bar->load_user_locale_translations(); + do_action( 'admin_bar_menu' ); + do_action( 'wp_before_admin_bar_render' ); $wp_admin_bar->render(); diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index 4e2d7c5da..06d691860 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -171,18 +171,18 @@ class WP_Admin_Bar { } function add_menus() { - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_me_separator', 10 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_my_account_menu', 20 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_my_sites_menu', 30 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_edit_menu', 40 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_new_content_menu', 50 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_comments_menu', 60 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_appearance_menu', 70 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_updates_menu', 80 ); - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_shortlink_menu', 90 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_me_separator', 10 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 20 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 30 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 40 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 50 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 70 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 80 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 ); if ( is_multisite() && is_super_admin() && function_exists('wp_admin_bar_superadmin_settings_menu') ) - add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_superadmin_settings_menu', 1000 ); + add_action( 'admin_bar_menu', 'wp_admin_bar_superadmin_settings_menu', 1000 ); do_action('add_admin_bar_menus'); }