Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/16/2013 12:52:42 AM (11 years ago)
Author:
boonebgorges
Message:

Do a better job preventing theme compat from running when current_theme_supports( 'buddypress' )

This changeset ensures that when a theme declares add_theme_support( 'buddypress' ),
BuddyPress will not load any of its theme compatibility layer. Previously,
'buddypress' support would prevent templates from loading, but would still
allow the buddypress-functions.php file to load in certain cases.

To this end, two new functions are introduced:

  • bp_detect_theme_compat_with_current_theme(), which centralizes the logic used by BuddyPress to detect whether the current theme will require theme compatibility (themes do not need theme compat when current_theme_supports( 'buddypress' ), when it's related to bp-default, or when members/members-loop.php is found). The function sets a global flag which can be checked later.
  • bp_use_theme_compat_with_current_theme(), which is used to check the flag set in bp_detect_theme_compat_with_current_theme().

Fixes #4879

Props r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template-loader.php

    r7138 r7432  
    382382function bp_load_theme_functions() {
    383383    global $pagenow;
     384
     385    // do not load our custom BP functions file if theme compat is disabled
     386    if ( ! bp_use_theme_compat_with_current_theme() ) {
     387        return;
     388    }
    384389
    385390    // Do not include on BuddyPress deactivation
Note: See TracChangeset for help on using the changeset viewer.