Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 24,006
- How-to & Troubleshooting
- 129,530
- Creating & Extending
- 25,790
- Requests & Feedback
- 9,496
- Third Party Plugins
- 9,784
- Showcase
- 3,316
- Ideas
- 1,397
- Miscellaneous
- 9,170
-
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 );
}
}
See also: WordPress.org • bbPress.org • BuddyPress.org • Matt • Blog RSS