Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/23/2024 03:16:00 AM (16 months 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/deprecated/14.0.php

    r13718 r13741  
    3232    _deprecated_function( __FUNCTION__, '14.0.0' );
    3333}
     34
     35/**
     36 * Should we use the WP Toolbar?
     37 *
     38 * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as
     39 * of BP 1.5. For BP 1.6, the WP Toolbar is the default.
     40 *
     41 * @since 1.5.0
     42 * @deprecated 14.0.0
     43 *
     44 * @return bool Default: true. False when WP Toolbar support is disabled.
     45 */
     46function bp_use_wp_admin_bar() {
     47    _deprecated_function( __FUNCTION__, '14.0.0' );
     48
     49    // Default to true.
     50    $use_admin_bar = true;
     51
     52    if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
     53        _doing_it_wrong( 'BP_USE_WP_ADMIN_BAR', esc_html__( 'The BP_USE_WP_ADMIN_BAR constant is deprecated.', 'buddypress' ), 'BuddyPress 14.0.0' );
     54    }
     55
     56    /**
     57     * Filters whether or not to use the admin bar.
     58     *
     59     * @since 1.5.0
     60     * @deprecated 14.0.0
     61     *
     62     * @param bool $use_admin_bar Whether or not to use the admin bar.
     63     */
     64    return apply_filters_deprecated( 'bp_use_wp_admin_bar', array( $use_admin_bar ), '14.0.0' );
     65}
Note: See TracChangeset for help on using the changeset viewer.