Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/25/2012 09:10:54 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Make sure user xprofile data is synced to WordPress user profile on user activation. Props magnus78. Fixes #4697.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r6574 r6659  
    426426 */
    427427function xprofile_sync_wp_profile( $user_id = 0 ) {
    428     global $bp, $wpdb;
     428
     429    $bp = buddypress();
    429430
    430431    if ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] )
     
    452453    bp_update_user_meta( $user_id, 'last_name',  $lastname  );
    453454
     455    global $wpdb;
     456
    454457    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
    455458}
    456459add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' );
    457 add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
     460add_action( 'bp_core_signup_user',      'xprofile_sync_wp_profile' );
     461add_action( 'bp_core_activated_user',   'xprofile_sync_wp_profile' );
    458462
    459463
Note: See TracChangeset for help on using the changeset viewer.