From b334556bbf97efb5d7c796f0b9318b49d8bb8ad0 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 19 Dec 2010 09:54:13 +0000 Subject: [PATCH] Less ugly show_admin_bar() enforcement. Fixes #15869 props filosofo. git-svn-id: https://develop.svn.wordpress.org/trunk@17057 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/admin-bar.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 70a0870543..e21d215ccc 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -48,7 +48,7 @@ add_action( 'init', 'wp_admin_bar_init' ); function wp_admin_bar_render() { global $wp_admin_bar; - if ( ! is_object( $wp_admin_bar ) ) + if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) return false; $wp_admin_bar->load_user_locale_translations(); @@ -312,11 +312,6 @@ function _admin_bar_bump_cb() { ?> function show_admin_bar( $show ) { global $show_admin_bar; $show_admin_bar = (bool) $show; - - // Remove the object if we are not going to be showing - // Otherwise you have to call this function prior to the init hook for it to work! - if ( ! $show_admin_bar && isset( $GLOBALS['wp_admin_bar'] ) ) - $GLOBALS['wp_admin_bar'] = null; } /**