Skip to:
Content

BuddyPress.org

Changeset 2818


Ignore:
Timestamp:
03/08/2010 03:28:57 PM (14 years ago)
Author:
apeatling
Message:

Fixes #2097, #2114

Location:
branches/1.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-signup.php

    r2695 r2818  
    235235    $bp->signup->username = $user_login;
    236236
     237    do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta );
     238
    237239    return $user_id;
    238240}
  • branches/1.2/bp-groups.php

    r2816 r2818  
    15451545    }
    15461546
     1547    groups_update_groupmeta( $group->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    15471548    do_action( 'groups_settings_updated', $group->id );
    15481549
  • branches/1.2/bp-xprofile.php

    r2794 r2818  
    888888 * @package BuddyPress Core
    889889 */
    890 function xprofile_sync_wp_profile() {
     890function xprofile_sync_wp_profile( $user_id = false ) {
    891891    global $bp, $wpdb;
    892892
     
    894894        return true;
    895895
    896     $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $bp->loggedin_user->id );
     896    if ( empty( $user_id ) )
     897        $user_id = $bp->loggedin_user->id;
     898
     899    if ( empty( $user_id ) )
     900        return false;
     901
     902    $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id );
    897903    $space = strpos( $fullname, ' ' );
    898904
     
    905911    }
    906912
    907     update_usermeta( $bp->loggedin_user->id, 'nickname', $fullname );
    908     update_usermeta( $bp->loggedin_user->id, 'first_name', $firstname );
    909     update_usermeta( $bp->loggedin_user->id, 'last_name', $lastname );
    910 
    911     $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $bp->loggedin_user->id ) );
    912     $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $bp->loggedin_user->id ), $bp->loggedin_user->id ) );
     913    update_usermeta( $user_id, 'nickname', $fullname );
     914    update_usermeta( $user_id, 'first_name', $firstname );
     915    update_usermeta( $user_id, 'last_name', $lastname );
     916
     917    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
     918    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) );
    913919}
    914920add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' );
    915 
     921add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
    916922
    917923/**
Note: See TracChangeset for help on using the changeset viewer.