Skip to:
Content

BuddyPress.org

Changeset 4631


Ignore:
Timestamp:
07/09/2011 07:24:36 PM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_use_wp_admin_bar() to reduce BP_USE_WP_ADMIN_BAR checks throughout BP. See #3314

Location:
trunk/bp-core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r4602 r4631  
    1010 */
    1111
    12 if ( !defined( 'BP_USE_WP_ADMIN_BAR' ) || defined( 'DOING_AJAX' ) )
     12if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
    1313    return;
    1414
  • trunk/bp-core/bp-core-buddybar.php

    r4602 r4631  
    510510
    511511    // Show the WordPress admin bar
    512     if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR && $wp_version >= 3.1 ) {
     512    if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) {
    513513        show_admin_bar( true );
    514514
    515515    // Hide the WordPress admin bar
    516     } elseif ( !defined( 'BP_DISABLE_ADMIN_BAR' ) || !BP_DISABLE_ADMIN_BAR ) {
     516    } elseif ( !bp_use_wp_admin_bar() ) {
    517517
    518518        // Keep the WP admin bar from loading
  • trunk/bp-core/bp-core-component.php

    r4567 r4631  
    251251            return;
    252252
    253         // Do not proceed if constant is not set or is false
    254         if ( !defined( 'BP_USE_WP_ADMIN_BAR' ) || !BP_USE_WP_ADMIN_BAR )
     253        // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false
     254        if ( !bp_use_wp_admin_bar() )
    255255            return;
    256256
  • trunk/bp-core/bp-core-functions.php

    r4630 r4631  
    12351235}
    12361236
     1237/**
     1238 * Should we use the WP admin bar?
     1239 *
     1240 * The WP Admin Bar, introduced in WP 3.1, is fully supported in BuddyPress as of BP 1.3.
     1241 *
     1242 * For the BP 1.3 development cycle, the BuddyBar will remain the default navigation for BP
     1243 * installations. In the future, this behavior will be changed, so that the WP Admin Bar is the
     1244 * default.
     1245 *
     1246 * @package BuddyPress
     1247 * @since 1.3
     1248 *
     1249 * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter
     1250 * @return bool False when WP Admin Bar support is disabled (default); true when enabled
     1251 */
     1252function bp_use_wp_admin_bar() {
     1253    return apply_filters( 'bp_use_wp_admin_bar', defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR );
     1254}
     1255
    12371256/** Global Manipulators *******************************************************/
    12381257
  • trunk/bp-core/bp-core-hooks.php

    r4567 r4631  
    6464 */
    6565function bp_setup_admin_bar() {
    66     if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR )
     66    if ( bp_use_wp_admin_bar() )
    6767        do_action( 'bp_setup_admin_bar' );
    6868}
Note: See TracChangeset for help on using the changeset viewer.