bbp_pre_get_option

Filter default options and allow them to be overloaded from inside the $bbp->options array.

Description

bbp_pre_get_option( (string) $value = '' ); 

Parameters (1)

0. $value — Optional. (string) => ''
Default value false

Usage

  1. if ( !function_exists( 'bbp_pre_get_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/core/options.php'; 
  3.  
  4. // Optional. Default value false 
  5. $value = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_pre_get_option($value); 
  9.  

Defined (1)

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

/includes/core/options.php  
  1. function bbp_pre_get_option( $value = '' ) { 
  2.  
  3. // Remove the filter prefix 
  4. $option = str_replace( 'pre_option_', '', current_filter() ); 
  5.  
  6. // Check the options global for preset value 
  7. if ( isset(bbpress)->options[$option] ) ) 
  8. $value =bbpress)->options[$option]; 
  9.  
  10. // Always return a value, even if false 
  11. return $value;