diff --git a/src/bp-core/bp-core-actions.php b/src/bp-core/bp-core-actions.php
index 67686b923..fe50c8a58 100644
|
a
|
b
|
add_action( 'bp_template_redirect', 'bp_get_request', 10 ); |
| 113 | 113 | /** |
| 114 | 114 | * Add the BuddyPress functions file and the Theme Compat Default features. |
| 115 | 115 | */ |
| 116 | | add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); |
| 117 | | add_action( 'bp_after_setup_theme', 'bp_register_theme_compat_default_features', 10 ); |
| | 116 | add_action( 'bp_after_setup_theme', 'bp_check_theme_template_pack_dependency', -10 ); |
| | 117 | add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); |
| | 118 | add_action( 'bp_after_setup_theme', 'bp_register_theme_compat_default_features', 10 ); |
| 118 | 119 | |
| 119 | 120 | // Load the admin. |
| 120 | 121 | if ( is_admin() ) { |
diff --git a/src/bp-core/bp-core-theme-compatibility.php b/src/bp-core/bp-core-theme-compatibility.php
index 74505bf8d..0bb0efb12 100644
|
a
|
b
|
function bp_theme_compat_loop_end( $query ) { |
| 987 | 987 | unset( $bp->theme_compat->is_page_toggled ); |
| 988 | 988 | } |
| 989 | 989 | add_action( 'loop_end', 'bp_theme_compat_loop_end' ); |
| | 990 | |
| | 991 | /** |
| | 992 | * Maybe override the preferred template pack if the theme declares a dependency. |
| | 993 | * |
| | 994 | * @since 3.0.0 |
| | 995 | */ |
| | 996 | function bp_check_theme_template_pack_dependency() { |
| | 997 | $all_packages = array_keys( buddypress()->theme_compat->packages ); |
| | 998 | |
| | 999 | foreach ( $all_packages as $package ) { |
| | 1000 | // e.g. "buddypress-use-nouveau", "buddypress-use-legacy". |
| | 1001 | if ( ! current_theme_supports( "buddypress-use-{$package}" ) ) { |
| | 1002 | continue; |
| | 1003 | } |
| | 1004 | |
| | 1005 | bp_setup_theme_compat( $package ); |
| | 1006 | return; |
| | 1007 | } |
| | 1008 | } |