bp_get_theme_compat_feature

Get a theme compat feature.

Description

(object) bp_get_theme_compat_feature( (string) $feature = '' ); 

Returns (object)

The feature settings.

Parameters (1)

0. $feature — Optional. (string) => ''
The feature (eg: cover_image).

Usage

  1. if ( !function_exists( 'bp_get_theme_compat_feature' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-theme-compatibility.php'; 
  3.  
  4. // The feature (eg: cover_image). 
  5. $feature = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_theme_compat_feature($feature); 
  9.  

Defined (1)

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

/bp-core/bp-core-theme-compatibility.php  
  1. function bp_get_theme_compat_feature( $feature = '' ) { 
  2. // Get current theme compat theme. 
  3. $theme_compat_theme =buddypress)->theme_compat->theme; 
  4.  
  5. // Get features. 
  6. $features = $theme_compat_theme->__get( 'features' ); 
  7.  
  8. if ( ! isset( $features[ $feature ] ) ) { 
  9. return false; 
  10.  
  11. return $features[ $feature ];