bp_add_options

Add default options when BuddyPress is first activated.

Description

bp_add_options(); 

Only called once when BuddyPress is activated. Non-destructive, so existing settings will not be overridden.


Usage

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

Defined (1)

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

/bp-core/bp-core-options.php  
  1. function bp_add_options() { 
  2.  
  3. // Get the default options and values. 
  4. $options = bp_get_default_options(); 
  5.  
  6. // Add default options. 
  7. foreach ( $options as $key => $value ) { 
  8. bp_add_option( $key, $value ); 
  9.  
  10. /** 
  11. * Fires after the addition of default options when BuddyPress is first activated. 
  12. * Allows previously activated plugins to append their own options. 
  13. * @since 1.6.0 
  14. */