Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author donmik

    (@atallos)

    Hi,

    I think so. I believe this link will help you.

    Thread Starter Lisa

    (@lisame)

    Hi,

    Thank you, but I don’t understand how that link we help me.

    Try this

    Example if your XProfile email filed = Email:

    function copy_xprofile_email_to_wp() {
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;
    $email_to_wp = xprofile_get_field_data(‘Email’, $user_id);
    wp_update_user( array (‘ID’ => $user_id, ‘user_email’ => $email_to_wp ) ) ;
    }
    add_action(‘bp_after_profile_edit_content’, ‘copy_xprofile_email_to_wp’);

    Thank you TNELN,
    But, where does the code go. Breaks site if used in functions.php and nothing happens if used in bp-custom.php.

    must use bp-custom.php

    It was a couple years ago a wrote this so can’t remember exactly what this does.

    It gets the field “Email” from current user id and passes it to wp after a profile edit.

    The field name must in this case be Email and you have to edit the profile from buddypress profile.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Sync email field with wordpress user email’ is closed to new replies.