bb_upgrade_all

The BuddyPress bb upgrade all function.

Description

bb_upgrade_all(); 

Usage

  1. if ( !function_exists( 'bb_upgrade_all' ) ) { 
  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_all(); 
  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_all() 
  2. if ( !ini_get( 'safe_mode' ) ) { 
  3. set_time_limit(600); 
  4.  
  5. $_do_user_operations = true; 
  6. if ( bb_get_option( 'wp_table_prefix' ) || ( defined( 'BB_SCHEMA_IGNORE_WP_USERS_TABLES' ) && BB_SCHEMA_IGNORE_WP_USERS_TABLES ) ) { 
  7. $_do_user_operations = false; 
  8.  
  9. $bb_upgrade = array(); 
  10.  
  11. // Pre DB Delta 
  12. if ( $_do_user_operations ) { 
  13. $bb_upgrade['messages'][] = bb_upgrade_160(); // Break blocked users 
  14. $bb_upgrade['messages'][] = bb_upgrade_170(); // Escaping in usermeta 
  15. $bb_upgrade['messages'][] = bb_upgrade_180(); // Delete users for real 
  16. $bb_upgrade['messages'][] = bb_upgrade_190(); // Move topic_resolved to topicmeta 
  17. $bb_upgrade['messages'][] = bb_upgrade_200(); // Indices 
  18. $bb_upgrade['messages'][] = bb_upgrade_210(); // Convert text slugs to varchar slugs 
  19. $bb_upgrade['messages'][] = bb_upgrade_220(); // remove bb_tagged primary key, add new column and primary key 
  20.  
  21. require_once( BACKPRESS_PATH . 'class.bp-sql-schema-parser.php' ); 
  22. require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' ); 
  23. $delta = BP_SQL_Schema_Parser::delta( $bbdb, $bb_queries, $bb_schema_ignore ); 
  24. if ( is_array( $delta ) ) { 
  25. $bb_upgrade['messages'] = array_merge($bb_upgrade['messages'], $delta['messages']); 
  26. $bb_upgrade['errors'] = $delta['errors']; 
  27. } else { 
  28. $bb_upgrade['errors'] = array(); 
  29.  
  30. // Post DB Delta 
  31. $bb_upgrade['messages'][] = bb_upgrade_1000(); // Make forum and topic slugs 
  32. $bb_upgrade['messages'][] = bb_upgrade_1010(); // Make sure all forums have a valid parent 
  33. if ( $_do_user_operations ) { 
  34. $bb_upgrade['messages'][] = bb_upgrade_1020(); // Add a user_nicename to existing users 
  35. $bb_upgrade['messages'][] = bb_upgrade_1030(); // Move admin_email option to from_email 
  36. $bb_upgrade['messages'][] = bb_upgrade_1040(); // Activate Akismet and bozo plugins and convert active plugins to new convention on upgrade only 
  37. $bb_upgrade['messages'][] = bb_upgrade_1050(); // Update active theme if present 
  38. $bb_upgrade['messages'][] = bb_upgrade_1070(); // trim whitespace from raw_tag 
  39. $bb_upgrade['messages'][] = bb_upgrade_1080(); // Convert tags to taxonomy 
  40. if ( $_do_user_operations ) { 
  41. $bb_upgrade['messages'][] = bb_upgrade_1090(); // Add display names 
  42. $bb_upgrade['messages'][] = bb_upgrade_1100(); // Replace forum_stickies index with stickies (#876) 
  43. $bb_upgrade['messages'][] = bb_upgrade_1110(); // Create plugin directory (#1083) 
  44. $bb_upgrade['messages'][] = bb_upgrade_1120(); // Create theme directory (#1083) 
  45. $bb_upgrade['messages'][] = bb_upgrade_1130(); // Add subscriptions option and set it to true (#1268) 
  46.  
  47.  
  48. $bb_upgrade['messages'] = array_filter($bb_upgrade['messages']); 
  49. $bb_upgrade['errors'] = array_filter($bb_upgrade['errors']); 
  50.  
  51. return $bb_upgrade;