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
This commit is contained in:
Peter Westwood 2010-12-19 09:54:13 +00:00
parent f660585656
commit b334556bbf
1 changed files with 1 additions and 6 deletions

View File

@ -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;
}
/**