Don't show the admin bar in the plugin/theme installers. Inserts condition directly into iframe_header(). Allows show_admin_bar() to be called after init by unsetting wp_admin_bar, thus preventing render once those hooks are fired. see #14772.

git-svn-id: https://develop.svn.wordpress.org/trunk@15938 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-10-23 19:49:25 +00:00
parent 6eb9fbbd39
commit cd50525faa
3 changed files with 12 additions and 3 deletions

View File

@ -1529,7 +1529,8 @@ function _admin_search_query() {
* *
*/ */
function iframe_header( $title = '', $limit_styles = false ) { function iframe_header( $title = '', $limit_styles = false ) {
global $hook_suffix; show_admin_bar( false );
global $hook_suffix;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head> <head>

View File

@ -62,7 +62,7 @@ function wp_admin_bar_render() {
if ( !is_object( $wp_admin_bar ) ) if ( !is_object( $wp_admin_bar ) )
return false; return false;
$wp_admin_bar->load_user_locale_translations(); $wp_admin_bar->load_user_locale_translations();
do_action( 'wp_before_admin_bar_render' ); do_action( 'wp_before_admin_bar_render' );
@ -226,7 +226,10 @@ add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_edit_menu', 100 );
* Load up the CSS needed to render the admin bar nice and pretty. * Load up the CSS needed to render the admin bar nice and pretty.
*/ */
function wp_admin_bar_css() { function wp_admin_bar_css() {
global $pagenow, $wp_locale; global $pagenow, $wp_locale, $wp_admin_bar;
if ( !is_object( $wp_admin_bar ) )
return false;
if ( !is_user_logged_in() ) if ( !is_user_logged_in() )
return; return;

View File

@ -4431,6 +4431,11 @@ function show_admin_bar( $show = null ) {
} else { } else {
$old_value = $show_admin_bar; $old_value = $show_admin_bar;
$show_admin_bar = $show; $show_admin_bar = $show;
// Prevent rendering if already initiated.
if ( ! $show_admin_bar && isset( $GLOBALS['wp_admin_bar'] ) )
$GLOBALS['wp_admin_bar'] = null;
return $old_value; return $old_value;
} }
} }