bp_use_wp_admin_bar()
Should we use the WP Toolbar?
Description
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.
Return
(bool) Default: true. False when WP Toolbar support is disabled.
Source
File: bp-core/bp-core-functions.php
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | function bp_use_wp_admin_bar() { // Default to true (to avoid loading deprecated BuddyBar code). $use_admin_bar = true; // Has the WP Toolbar constant been explicitly opted into? if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) { $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR; // ...or is the old BuddyBar being forced back into use? } elseif ( bp_force_buddybar( false ) ) { $use_admin_bar = false; } /** * Filters whether or not to use the admin bar. * * @since BuddyPress 1.5.0 * * @param bool $use_admin_bar Whether or not to use the admin bar. */ return (bool) apply_filters( 'bp_use_wp_admin_bar' , $use_admin_bar ); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.