WordPress.org

Make WordPress Core

Ticket #15869: less-ugly-admin-bar-hide.diff

File less-ugly-admin-bar-hide.diff, 1.0 KB (added by filosofo, 11 years ago)
  • wp-includes/admin-bar.php

     
    4848function wp_admin_bar_render() {
    4949        global $wp_admin_bar;
    5050
    51         if ( ! is_object( $wp_admin_bar ) )
     51        if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) )
    5252                return false;
    5353
    5454        $wp_admin_bar->load_user_locale_translations();
  • wp-includes/functions.php

     
    44844484function show_admin_bar( $show ) {
    44854485        global $show_admin_bar;
    44864486        $show_admin_bar = (bool) $show;
    4487        
    4488         // Remove the object if we are not going to be showing
    4489         // Otherwise you have to call this function prior to the init hook for it to work!
    4490         if ( ! $show_admin_bar && isset( $GLOBALS['wp_admin_bar'] ) )
    4491                 $GLOBALS['wp_admin_bar'] = null;
    44924487}
    44934488
    4494 ?>
    4495  No newline at end of file
     4489?>