Skip to:
Content
Pages
Categories
Search
Top
Bottom

Let members change their first_name and last_name in WP user's profile

  • Avatar of mgpix
    mgpix
    Participant

    @mgpix

    Hello,

    I’m using BP 1.2.3 on a WordPress 2.9.2 install with the WP-FB-AutoConnect plugin.

    On registration, WP-FB-AutoConnect automatically set the user first_name and last_name and I like that. However, once registred users can not change these first_name and last_name when editing their BP profile.

    Is it possible to let members change the WP user data in adition the the BP profile fields ?

Viewing 1 replies (of 1 total)
  • Avatar of mgpix
    mgpix
    Participant

    @mgpix

    Ok, I eventually found a workaround.

    The below code will update firstname and lastname fields in the BP member profile upon user registration :


    add_action('user_register', 'my_user_register');
    function my_user_register($user_id)
    {
    if ( function_exists( 'xprofile_set_field_data' ) ) {
    $firstname = get_usermeta( $user_id, 'first_name' );
    $lastname = get_usermeta( $user_id, 'last_name' );
    xprofile_set_field_data( 'firstname', $user_id, $firstname );
    xprofile_set_field_data( 'lastname', $user_id, $lastname );
    }
    }

Viewing 1 replies (of 1 total)

The topic ‘Let members change their first_name and last_name in WP user's profile’ is closed to new replies.