Make WordPress Core

Changeset 17057


Ignore:
Timestamp:
12/19/2010 09:54:13 AM (14 years ago)
Author:
westi
Message:

Less ugly show_admin_bar() enforcement. Fixes #15869 props filosofo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r17032 r17057  
    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
     
    313313    global $show_admin_bar;
    314314    $show_admin_bar = (bool) $show;
    315    
    316     // Remove the object if we are not going to be showing
    317     // Otherwise you have to call this function prior to the init hook for it to work!
    318     if ( ! $show_admin_bar && isset( $GLOBALS['wp_admin_bar'] ) )
    319         $GLOBALS['wp_admin_bar'] = null;
    320315}
    321316
Note: See TracChangeset for help on using the changeset viewer.