From cd0c3f605e3aab2301fcd836614a627d3adede8a Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 30 Sep 2011 18:07:14 +0000 Subject: [PATCH] Consult the main query when determining whether to show the edit menu in the admin bar. This insulates the admin bar from query_posts() queries made by themes and plugins. Props SergeyBiryukov. fixes #16798 git-svn-id: http://svn.automattic.com/wordpress/trunk@18844 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index bdf95e1d9..897d2c740 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -366,7 +366,7 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) { * @since 3.1.0 */ function wp_admin_bar_edit_menu( $wp_admin_bar ) { - global $post, $tag; + global $post, $tag, $wp_the_query; if ( is_admin() ) { $current_screen = get_current_screen(); @@ -394,9 +394,9 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { ) ); } } else { - $current_object = get_queried_object(); + $current_object = $wp_the_query->get_queried_object(); - if ( empty($current_object) ) + if ( empty( $current_object ) ) return; if ( ! empty( $current_object->post_type )