Ensure show_admin_bar( false ) works after init. Fixes #15856.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-12-17 08:34:36 +00:00
parent c1b7a3ef59
commit ea07e29db6
1 changed files with 5 additions and 0 deletions

View File

@ -4484,6 +4484,11 @@ function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = ar
function show_admin_bar( $show ) { function show_admin_bar( $show ) {
global $show_admin_bar; global $show_admin_bar;
$show_admin_bar = (bool) $show; $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;
} }
?> ?>