Skip to:
Content

BuddyPress.org

Ticket #4803: 4803.01.patch

File 4803.01.patch, 2.0 KB (added by r-a-y, 12 years ago)
  • bp-core/bp-core-actions.php

    add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); 
    6666add_action( 'bp_init', 'bp_setup_globals',           4  );
    6767add_action( 'bp_init', 'bp_setup_nav',               6  );
    6868add_action( 'bp_init', 'bp_setup_title',             8  );
    69 add_action( 'bp_init', 'bp_core_load_admin_bar',     10 );
    7069add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 );
    7170
    7271/**
  • bp-core/bp-core-adminbar.php

    add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); 
    6262 * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer'
    6363 */
    6464function bp_core_load_admin_bar() {
    65         global $wp_version;
    66 
    67         // Don't show if Toolbar is disabled for non-logged in users
    68         if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && ! is_user_logged_in() )
    69                 return;
    70 
    71         // Show the WordPress Toolbar
    72         if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) {
    73 
    74                 // Respect user's Toolbar display preferences
    75                 if ( is_user_logged_in() && ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) )
    76                         return;
    77 
     65        // Show the Toolbar for logged out users
     66        if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
    7867                show_admin_bar( true );
     68        }
    7969
    80         // Hide the WordPress Toolbar
    81         } elseif ( !bp_use_wp_admin_bar() ) {
     70        // Hide the WordPress Toolbar and show the BuddyBar
     71        if ( ! bp_use_wp_admin_bar() ) {
    8272
    8373                // Keep the WP Toolbar from loading
    8474                show_admin_bar( false );
    function bp_core_load_admin_bar() { 
    9585                add_action( 'admin_footer', 'bp_core_admin_bar'    );
    9686        }
    9787}
     88add_action( 'init', 'bp_core_load_admin_bar', 9 );
    9889
    9990/**
    10091 * Handle the Toolbar CSS