bp_add_option

Add an option.

Description

bp_add_option( (string) $option_name, (mixed) $value ); 

This is a wrapper for , which in turn stores settings data on the appropriate blog, given your current setup.

Parameters (2)

0. $option_name (string)
The option key to be set.
1. $value (mixed)
The value to be set.

Usage

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

Defined (1)

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

/bp-core/bp-core-options.php  
  1. function bp_add_option( $option_name, $value ) { 
  2. return add_blog_option( bp_get_root_blog_id(), $option_name, $value );