bp_use_wp_admin_bar

Should we use the WP Toolbar?.

Description

bp_use_wp_admin_bar(); 

The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as of BP 1.5. For BP 1.6, the WP Toolbar is the default.


Usage

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

Defined (1)

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

/bp-core/bp-core-functions.php  
  1. function bp_use_wp_admin_bar() { 
  2.  
  3. // Default to true (to avoid loading deprecated BuddyBar code). 
  4. $use_admin_bar = true; 
  5.  
  6. // Has the WP Toolbar constant been explicitly opted into? 
  7. if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) { 
  8. $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR; 
  9.  
  10. // ...or is the old BuddyBar being forced back into use? 
  11. } elseif ( bp_force_buddybar( false ) ) { 
  12. $use_admin_bar = false; 
  13.  
  14. /** 
  15. * Filters whether or not to use the admin bar. 
  16. * @since 1.5.0 
  17. * @param bool $use_admin_bar Whether or not to use the admin bar. 
  18. */ 
  19. return (bool) apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );