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: https://develop.svn.wordpress.org/trunk@18844 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b587d4c2ac
commit
0fb49c10e3
@ -366,7 +366,7 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
|
|||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*/
|
*/
|
||||||
function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||||
global $post, $tag;
|
global $post, $tag, $wp_the_query;
|
||||||
|
|
||||||
if ( is_admin() ) {
|
if ( is_admin() ) {
|
||||||
$current_screen = get_current_screen();
|
$current_screen = get_current_screen();
|
||||||
@ -394,9 +394,9 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
|||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$current_object = get_queried_object();
|
$current_object = $wp_the_query->get_queried_object();
|
||||||
|
|
||||||
if ( empty($current_object) )
|
if ( empty( $current_object ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( ! empty( $current_object->post_type )
|
if ( ! empty( $current_object->post_type )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user