bp_core_get_root_option

Get a root option.

Description

bp_core_get_root_option( (string) $option ); 

"Root options" are those that apply across an entire installation, and are fetched only a single time during a pageload and stored in buddypress/2.8.2/functions/buddypress" title="buddypress" class="code function">buddypress()->site_options to prevent future lookups. See buddypress/2.8.2/functions/bp_core_get_root_options/" title="bp_core_get_root_options" class="code function">bp_core_get_root_options().

Parameters (1)

0. $option (string)
Name of the option key.

Usage

  1. if ( !function_exists( 'bp_core_get_root_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-options.php'; 
  3.  
  4. // Name of the option key. 
  5. $option = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_get_root_option($option); 
  9.  

Defined (1)

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

/bp-core/bp-core-options.php  
  1. function bp_core_get_root_option( $option ) { 
  2. $bp =buddypress); 
  3.  
  4. if ( ! isset( $bp->site_options ) ) { 
  5. $bp->site_options = bp_core_get_root_options(); 
  6.  
  7. $value = ''; 
  8. if ( isset( $bp->site_options[ $option ] ) ) { 
  9. $value = $bp->site_options[ $option ]; 
  10.  
  11. return $value;