bb_upgrade_1040

The BuddyPress bb upgrade 1040 function.

Description

bb_upgrade_1040(); 

Usage

  1. if ( !function_exists( 'bb_upgrade_1040' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_upgrade_1040(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php  
  1. function bb_upgrade_1040() { 
  2. if ( ( $dbv = bb_get_option_from_db( 'bb_db_version' ) ) && $dbv >= 1230 ) 
  3. return; 
  4.  
  5. // Only do this when upgrading 
  6. if ( defined( 'BB_UPGRADING' ) && BB_UPGRADING ) { 
  7. $plugins = bb_get_option('active_plugins'); 
  8. if ( bb_get_option('akismet_key') && !in_array('core#akismet.php', $plugins) ) { 
  9. $plugins[] = 'core#akismet.php'; 
  10. if ( !in_array('core#bozo.php', $plugins) ) { 
  11. $plugins[] = 'core#bozo.php'; 
  12.  
  13. $new_plugins = array(); 
  14. foreach ($plugins as $plugin) { 
  15. if (substr($plugin, 0, 5) != 'core#') { 
  16. if ($plugin != 'akismet.php' && $plugin != 'bozo.php') { 
  17. $new_plugins[] = 'user#' . $plugin; 
  18. } else { 
  19. $new_plugins[] = $plugin; 
  20.  
  21. bb_update_option( 'active_plugins', $new_plugins ); 
  22.  
  23. bb_update_option( 'bb_db_version', 1230 ); 
  24.  
  25. return 'Done activating Akismet and Bozo plugins and converting active plugins to new convention on upgrade only: ' . __FUNCTION__;