bb_upgrade_170

The BuddyPress bb upgrade 170 function.

Description

bb_upgrade_170(); 

Usage

  1. if ( !function_exists( 'bb_upgrade_170' ) ) { 
  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_170(); 
  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_170() { 
  2. if ( ( $dbv = bb_get_option_from_db( 'bb_db_version' ) ) && $dbv >= 536 ) 
  3. return; 
  4.  
  5. global $bbdb; 
  6. foreach ( (array) $bbdb->get_results("SELECT * FROM $bbdb->usermeta WHERE meta_value LIKE '%"%' OR meta_value LIKE '%'%'") as $meta ) { 
  7. $value = str_replace(array('"', '''), array('"', "'"), $meta->meta_value); 
  8. $value = stripslashes($value); 
  9. bb_update_usermeta( $meta->user_id, $meta->meta_key, $value); 
  10. bb_update_option( 'bb_db_version', 536 ); 
  11. return 'Done updating usermeta: ' . __FUNCTION__;