diff --git bp-core/bp-core-update.php bp-core/bp-core-update.php
index cc9dd70..50bdc4d 100644
|
|
function bp_update_to_2_0() { |
361 | 361 | /** Migrate signups data **************************************************/ |
362 | 362 | |
363 | 363 | if ( ! is_multisite() ) { |
| 364 | global $wpdb; |
364 | 365 | |
365 | 366 | // Maybe install the signups table |
366 | 367 | bp_core_maybe_install_signups(); |
367 | 368 | |
368 | | $signups = get_users( array( |
369 | | 'fields' => 'all_with_meta', |
370 | | 'meta_key' => 'activation_key', |
371 | | 'meta_compare' => 'EXISTS', |
372 | | ) ); |
373 | | |
374 | | if ( empty( $signups ) ) { |
| 369 | $status_2_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users} WHERE user_status = '2'" ); |
| 370 | |
| 371 | if ( ! empty( $status_2_ids ) ) { |
| 372 | $signups = get_users( array( |
| 373 | 'fields' => array( |
| 374 | 'ID', |
| 375 | 'user_login', |
| 376 | 'user_pass', |
| 377 | 'user_registered', |
| 378 | 'user_email', |
| 379 | 'display_name' |
| 380 | ), |
| 381 | 'include' => $status_2_ids, |
| 382 | ) ); |
| 383 | } else { |
375 | 384 | return; |
376 | 385 | } |
377 | 386 | |
378 | 387 | foreach ( $signups as $signup ) { |
379 | 388 | $meta = array(); |
380 | 389 | |
| 390 | // We need to rebuild the activation key |
| 391 | $signup->activation_key = wp_hash( $signup->ID ); |
| 392 | |
381 | 393 | if ( bp_is_active( 'xprofile' ) ) { |
382 | 394 | $meta['field_1'] = $signup->display_name; |
383 | 395 | } |