Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/23/2024 03:16:00 AM (10 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/bp-core-adminbar.php

    r13395 r13741  
    2424
    2525    // Bail if this is an ajax request.
    26     if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
     26    if ( wp_doing_ajax() ) {
    2727        return;
     28    }
    2829
    2930    // Only add menu for logged in user.
     
    5455        show_admin_bar( true );
    5556    }
    56 
    57     // Hide the WordPress Toolbar.
    58     if ( ! bp_use_wp_admin_bar() ) {
    59         // Keep the WP Toolbar from loading.
    60         show_admin_bar( false );
    61     }
    6257}
    6358add_action( 'init', 'bp_core_load_admin_bar', 9 );
     
    8782function bp_core_enqueue_admin_bar_css() {
    8883
    89     // Bail if not using WordPress's admin bar or it's not showing on this
    90     // page request.
    91     if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) {
     84    // Bail if WordPress's admin bar is not showing on this page request.
     85    if ( ! is_admin_bar_showing() ) {
    9286        return;
    9387    }
Note: See TracChangeset for help on using the changeset viewer.