/** * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over * to the WP Toolbar. * * @since BuddyPress (1.6) */ function bp_admin_setting_callback_force_buddybar() { ?> <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked(!bp_force_buddybar(true)); ?> /> <label for="_bp_force_buddybar"><?php _e('Switch to WordPress Toolbar', 'buddypress'); ?> </label> <?php }
/** * Should we use the WP Toolbar? * * 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. * * @since BuddyPress (1.5.0) * * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter. * * @return bool Default: true. False when WP Toolbar support is disabled. */ 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; } return (bool) apply_filters('bp_use_wp_admin_bar', $use_admin_bar); }