bb_get_user_setting

Retrieve user interface setting value based on setting name.

Description

bb_get_user_setting( (string) $name, (bool) $default = false ); 

Parameters (2)

0. $name (string)
The name of the setting.
1. $default — Optional. (bool) => false
Default value to return when $name is not set.

Usage

  1. if ( !function_exists( 'bb_get_user_setting' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php'; 
  3.  
  4. // The name of the setting. 
  5. $name = ''; 
  6.  
  7. // Optional default value to return when $name is not set. 
  8. $default = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_get_user_setting($name, $default); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-meta.php  
  1. function bb_get_user_setting( $name, $default = false ) 
  2.  
  3. return isset( $arr[$name] ) ? $arr[$name] : $default;