bb_get_theme_directory

The BuddyPress bb get theme directory function.

Description

bb_get_theme_directory( (bool) $theme = false ); 

Parameters (1)

0. $theme — Optional. (bool) => false
The theme.

Usage

  1. if ( !function_exists( 'bb_get_theme_directory' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4. // The theme. 
  5. $theme = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_theme_directory($theme); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_get_theme_directory( $theme = false ) 
  2. global $bb; 
  3. if ( !$theme ) { 
  4. $theme = bb_get_option( 'bb_active_theme' ); 
  5. if ( preg_match( '/^([a-z0-9_-]+)#([\.a-z0-9_-]+)$/i', $theme, $_matches ) ) { 
  6. $theme_directory = $bb->theme_locations[$_matches[1]]['dir'] . $_matches[2] . '/'; 
  7. } else { 
  8. $theme_directory = BB_DEFAULT_THEME_DIR
  9. return $theme_directory;