bp_get_option

Retrieve an option.

Description

bp_get_option( (string) $option_name, (string) $default = '' ); 

This is a wrapper for , which in turn stores settings data (such as bp-pages) on the appropriate blog, given your current setup.

The bp_get_option filter is primarily for backward-compatibility.

Parameters (2)

0. $option_name (string)
The option to be retrieved.
1. $default — Optional. (string) => ''
The default.

Usage

  1. if ( !function_exists( 'bp_get_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-options.php'; 
  3.  
  4. // The option to be retrieved. 
  5. $option_name = ''; 
  6.  
  7. // The default. 
  8. $default = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_get_option($option_name, $default); 
  12.  

Defined (1)

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

/bp-core/bp-core-options.php  
  1. function bp_get_option( $option_name, $default = '' ) { 
  2. $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default ); 
  3.  
  4. /** 
  5. * Filters the option value for the requested option. 
  6. * @since 1.5.0 
  7. * @param mixed $value The value for the option. 
  8. */ 
  9. return apply_filters( 'bp_get_option', $value );