I emailed Anton and he replied with this:
hey sure
here is the code
just put it in the functions.php
and change the names of the s1member filed ids with the proper buddypress field names.
/* ----------- POPULATING CUSTOM FIELDS AT REGISTRATION ------------- */
add_action('wp_head', 'ch_s2_registration_field_population', 10, 2);
function ch_s2_registration_field_population() {
global $current_user;
get_currentuserinfo();
// Do that only at the first login of the user
if(get_user_field("s2member_login_counter") < 2) {
if(xprofile_get_field_data('Spouse Name', $current_user->id) == '' && get_user_field('Spouse_Name') != '' ) { // checking if the BP field is empty and s2Member field is not…
xprofile_set_field_data('Spouse Name', $current_user->id, get_user_field('Spouse_Name')); // then populating it.
}
if(xprofile_get_field_data('Address', $current_user->id) == '' && get_user_field('Address') != '' ) {
xprofile_set_field_data('Address', $current_user->id, get_user_field('Address'));
}
if(xprofile_get_field_data('City', $current_user->id) == '' && get_user_field('City') != '' ) {
xprofile_set_field_data('City', $current_user->id, get_user_field('City'));
}
if(xprofile_get_field_data('State', $current_user->id) == '' && get_user_field('State') != '' ) {
xprofile_set_field_data('State', $current_user->id, get_user_field('State'));
}
if(xprofile_get_field_data('Zip', $current_user->id) == '' && get_user_field('Zip') != '' ) {
xprofile_set_field_data('Zip', $current_user->id, get_user_field('Zip'));
}
if(xprofile_get_field_data('Home Phone Number', $current_user->id) == '' && get_user_field('Home_Phone_Number') != '' ) {
xprofile_set_field_data('Home Phone Number', $current_user->id, get_user_field('Home_Phone_Number'));
}
if(xprofile_get_field_data('Cell Phone', $current_user->id) == '' && get_user_field('Cell_Phone') != '' ) {
xprofile_set_field_data('Cell Phone', $current_user->id, get_user_field('Cell_Phone'));
}
if(xprofile_get_field_data('Occupation/Family Businesses and Services', $current_user->id) == '' && get_user_field('Occupation_Family_Busines') != '' ) {
xprofile_set_field_data('Occupation/Family Businesses and Services', $current_user->id, get_user_field('Occupation_Family_Busines'));
}
if(xprofile_get_field_data('Family Interests and Hobbies', $current_user->id) == '' && get_user_field('Family_Interests_Hobby') != '' ) {
xprofile_set_field_data('Family Interests and Hobbies', $current_user->id, get_user_field('Family_Interests_Hobby'));
}
if(xprofile_get_field_data('Church', $current_user->id) == '' && get_user_field('Church') != '' ) {
xprofile_set_field_data('Church', $current_user->id, get_user_field('Church'));
}
}
}