Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,863
- How-to & Troubleshooting
- 128,914
- Creating & Extending
- 25,744
- Requests & Feedback
- 9,445
- Third Party Plugins
- 9,773
- Showcase
- 3,317
- Ideas
- 1,389
- Miscellaneous
- 9,135
-
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