bb_get_template

The BuddyPress bb get template function.

Description

bb_get_template( $file, (bool) $default = true ); 

Parameters (2)

0. $file
The file.
1. $default — Optional. (bool) => true
The default.

Usage

  1. if ( !function_exists( 'bb_get_template' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The file. 
  5. $file = null; 
  6.  
  7. // The default. 
  8. $default = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_get_template($file, $default); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_template( $file, $default = true ) 
  2. global $bb; 
  3. // Skip theme loading in "safe" mode 
  4. if ( !isset( $bb->safemode ) || $bb->safemode !== true ) { 
  5. if ( file_exists( bb_get_active_theme_directory() . $file ) ) { 
  6. return bb_get_active_theme_directory() . $file; 
  7.  
  8. if ( !$default ) { 
  9. return false; 
  10.  
  11. return bb_get_default_template( $file );