Skip to:
Content

BuddyPress.org

Changeset 5119


Ignore:
Timestamp:
09/07/2011 02:57:48 PM (13 years ago)
Author:
boonebgorges
Message:

Respect 'hide-loggedout-adminbar' when using WP admin bar. References #3560. Props cnorris23

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-buddybar.php

    r5103 r5119  
    527527 * Handle the Admin Bar/BuddyBar business
    528528 *
    529  * @global num $wp_version
    530  * @todo Clean up global constants
     529 * @since 1.2.0
     530 *
     531 * @global string $wp_version
     532 * @uses bp_get_option()
     533 * @uses is_user_logged_in()
     534 * @uses bp_use_wp_admin_bar()
     535 * @uses show_admin_bar()
     536 * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo'
     537 * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus'
     538 * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus'
     539 * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus'
     540 * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus'
     541 * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer'
     542 * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer'
    531543 */
    532544function bp_core_load_admin_bar() {
    533545    global $wp_version;
     546
     547    // Don't show if admin bar is disabled for non-logged in users
     548    if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
     549        return;
    534550
    535551    // Show the WordPress admin bar
     
    542558        // Keep the WP admin bar from loading
    543559        show_admin_bar( false );
    544 
    545         if ( (int)bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
    546             return;
    547560
    548561        // Actions used to build the BP admin bar
Note: See TracChangeset for help on using the changeset viewer.