Skip to:
Content

BuddyPress.org

Ticket #2023: 2023.patch

File 2023.patch, 2.1 KB (added by TobiasBg, 12 years ago)

Patch do add better constant checks

  • bp-core.php

     
    4444if ( bp_core_is_multisite() )
    4545        require ( BP_PLUGIN_DIR . '/bp-core/bp-core-activation.php' );
    4646
    47 /* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar. */
    48 if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) )
     47/* If BP_DISABLE_ADMIN_BAR is defined and set to true, do not load the global admin bar. */
     48if ( ! ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
    4949        require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' );
    5050
    5151/* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */
  • bp-core/bp-core-adminbar.php

     
    33function bp_core_admin_bar() {
    44        global $bp, $wpdb, $current_blog;
    55
    6         if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
     6        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
    77                return false;
    88
    99        if ( (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
  • bp-core/bp-core-cssjs.php

     
    1111function bp_core_add_admin_bar_css() {
    1212        global $bp, $current_blog;
    1313
    14         if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
     14        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
    1515                return false;
    1616
    1717        if ( ( bp_core_is_multisite() && $current_blog->blog_id != BP_ROOT_BLOG ) || is_admin() ) {
     
    174174function bp_core_override_adminbar_css() {
    175175        global $bp;
    176176
    177         if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( $bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() ) ) {
     177        if ( ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) || ( $bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() ) ) {
    178178        ?>
    179179<style type="text/css">body { padding-top: 0 !important; } #wp-admin-bar { display: none; }</style>
    180180        <?php }