bp_core_admin_bar

Wrapper function for rendering the BuddyBar.

Description

(bool|null) bp_core_admin_bar(); 

Returns (bool|null)

Returns false if the BuddyBar is disabled.


Usage

  1. if ( !function_exists( 'bp_core_admin_bar' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/2.1.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_admin_bar(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/deprecated/2.1.php  
  1. function bp_core_admin_bar() { 
  2. $bp =buddypress); 
  3.  
  4. if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) { 
  5. return false; 
  6.  
  7. if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) { 
  8. return false; 
  9.  
  10. $bp->doing_admin_bar = true; 
  11.  
  12. echo '<div id="wp-admin-bar"><div class="padder">'; 
  13.  
  14. // **** Do bp-adminbar-logo Actions ******** 
  15.  
  16. echo '<ul class="main-nav">'; 
  17.  
  18. // **** Do bp-adminbar-menus Actions ******** 
  19.  
  20. echo '</ul>'; 
  21. echo "</div></div><!-- #wp-admin-bar -->\n\n"; 
  22.  
  23. $bp->doing_admin_bar = false;