Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/23/2024 03:16:00 AM (2 years ago)
Author:
imath
Message:

Deprecate bp_use_wp_admin_bar() & BP_USE_WP_ADMIN_BAR

This function and constant were useful when BuddyPress was including an alternative toolbar to the WordPress Admin Bar called the "BuddyBar". The BuddyBar was removed in [12893] but we forgot to deprecate bp_use_wp_admin_bar() & BP_USE_WP_ADMIN_BAR. This commit is finally achieving the step we missed almost 3 years ago.

Props espellcaste, emaralive

Fixes #9104
Closes https://github.com/buddypress/buddypress/pull/234

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r13718 r13741  
    498498     */
    499499    return apply_filters( 'bp_is_username_compatibility_mode', defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) && BP_ENABLE_USERNAME_COMPATIBILITY_MODE );
    500 }
    501 
    502 /**
    503  * Should we use the WP Toolbar?
    504  *
    505  * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as
    506  * of BP 1.5. For BP 1.6, the WP Toolbar is the default.
    507  *
    508  * @since 1.5.0
    509  *
    510  * @return bool Default: true. False when WP Toolbar support is disabled.
    511  */
    512 function bp_use_wp_admin_bar() {
    513 
    514     // Default to true.
    515     $use_admin_bar = true;
    516 
    517     // Has the WP Toolbar constant been explicitly opted into?
    518     if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
    519         $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
    520     }
    521 
    522     /**
    523      * Filters whether or not to use the admin bar.
    524      *
    525      * @since 1.5.0
    526      *
    527      * @param bool $use_admin_bar Whether or not to use the admin bar.
    528      */
    529     return (bool) apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );
    530500}
    531501
Note: See TracChangeset for help on using the changeset viewer.