Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Make 2+ part name in full name required + xprofile_sync_wp_profile()


peterverkooijen
Participant

@peterverkooijen

bp-xprofile-signup.php has a promising looking function:

xprofile_on_activate_user()

When a user activates their account, move the extra field data to the correct tables.

function xprofile_extract_signup_meta( $user_id, $meta ) {
// Extract signup meta fields to fill out profile
$field_ids = $meta['xprofile_field_ids'];
$field_ids = explode( ',', $field_ids );

// Loop through each bit of profile data and save it to profile.
for ( $i = 0; $i < count($field_ids); $i++ ) {
if ( empty( $field_ids[$i] ) ) continue;

$field_value = $meta["field_{$field_ids[$i]}"];

$field = new BP_XProfile_ProfileData();
$field->user_id = $user_id;
$field->value = $field_value;
$field->field_id = $field_ids[$i];
$field->last_updated = time();

$field->save();
}

update_usermeta( $user_id, 'last_activity', time() );
}

Does $field->save(); have something to do with function save()?

function update_usermeta actually updates wp_usermeta. So why is field_1 not stored in wp_usermeta?! Very confused…

Skip to toolbar