Skip to:
Content

BuddyPress.org

Changeset 6946


Ignore:
Timestamp:
04/26/2013 01:42:46 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Fix toolbar not showing for logged out users. Props r-a-y. Fixes #4803.

Location:
trunk/bp-core
Files:
2 edited

Legend:

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

    r6822 r6946  
    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
  • trunk/bp-core/bp-core-adminbar.php

    r6762 r6946  
    6363 */
    6464function bp_core_load_admin_bar() {
    65         global $wp_version;
    6665
    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;
     66        // Show the Toolbar for logged out users
     67        if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
     68                show_admin_bar( true );
     69        }
    7070
    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 
    78                 show_admin_bar( true );
    79 
    80         // Hide the WordPress Toolbar
    81         } elseif ( !bp_use_wp_admin_bar() ) {
     71        // Hide the WordPress Toolbar and show the BuddyBar
     72        if ( ! bp_use_wp_admin_bar() ) {
    8273
    8374                // Keep the WP Toolbar from loading
    … …  
    9687        }
    9788}
     89add_action( 'init', 'bp_core_load_admin_bar', 9 );
    9890
    9991/**
Note: See TracChangeset for help on using the changeset viewer.