BUDDYPRESS: HIDE NAME FIELD IN REGISTRATION PAGE AND AUTOMATICALLY INSERT WORDPRESS USERNAME IN IT.

Hello, I have been searching for an answer on How To Hide Name Field In Buddypress Registration Page And Automatically Insert WordPress Username In It and I found This Topic. The guy named @aaronthomas1979 claims that he does exactly what I’m trying to do on his site, and he gives his site register.php so others could see what he has done. The problem is i don’t know where to find this command in his register.php file. Also I have wrote to live support today and one guy managed to make a code from the guy named @ositive simular to what i need, it generates username from name field, that is exactly reverse of what i need, the problem with this is that if a person writes the name with space or other unknown simbol. The username is different, and the person won’t be able to login with username, so what i need to to insert the username and generate the same name from it. The code that the support staff created for me is:

add_action( 'bp_core_validate_user_signup', 'custom_validate_user_signup' );

function custom_validate_user_signup($result){

unset($result['errors']->errors['user_name']);

if(!empty($_POST['field_1']))
{
$result['user_name'] = $_POST['field_1'];
$_POST['signup_username'] = $result['user_name'];

if(!empty($_POST['field_1']))
{
$result['user_name'] = $_POST['field_1'];
$_POST['signup_username'] = $result['user_name'];
$result['user'] = $_POST['field_1'];
$_POST['signup_password_confirm']=$_POST['signup_password'];
}
return $result;
}

I’m kindly asking for your help, if you could find it in @aaronthomas1979 site or make one for me.