bp_core_activate_site_options

Copy BP options from a single site to multisite config.

Description

bp_core_activate_site_options( (array) $keys = array() ); 

Run when switching from single to multisite and we need to copy blog options to site options.

This function is no longer used.

Parameters (1)

0. $keys — Optional. (array) => array()
Array of site options.

Usage

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

Defined (1)

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

/bp-core/bp-core-options.php  
  1. function bp_core_activate_site_options( $keys = array() ) { 
  2.  
  3. if ( !empty( $keys ) && is_array( $keys ) ) { 
  4. $bp =buddypress); 
  5.  
  6. $errors = false; 
  7.  
  8. foreach ( $keys as $key => $default ) { 
  9. if ( empty( $bp->site_options[ $key ] ) ) { 
  10. $bp->site_options[ $key ] = bp_get_option( $key, $default ); 
  11.  
  12. if ( !bp_update_option( $key, $bp->site_options[ $key ] ) ) { 
  13. $errors = true; 
  14.  
  15. if ( empty( $errors ) ) { 
  16. return true; 
  17.  
  18. return false;