bbp_setup_theme_compat( BBP_Theme_Compat $theme = 'default' )
Setup the active template pack and register it’s directory in the stack.
Description Description
Parameters Parameters
- $theme
-
(Optional)
Default value: 'default'
Source Source
File: includes/core/theme-compat.php
function bbp_setup_theme_compat( $theme = 'default' ) {
$bbp = bbpress();
// Bail if something already has this under control
if ( ! empty( $bbp->theme_compat->theme ) ) {
return;
}
// Fallback for empty theme
if ( empty( $theme ) ) {
$theme = 'default';
}
// If the theme is registered, use it and add it to the stack
if ( isset( $bbp->theme_compat->packages[ $theme ] ) ) {
$bbp->theme_compat->theme = $bbp->theme_compat->packages[ $theme ];
// Setup the template stack for the active template pack
bbp_register_template_stack( array( $bbp->theme_compat->theme, 'get_dir' ) );
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |