Re: How can I hide certain xprofile custom fields groups in the registration page?
Well, yes, you should be able to make the username field non-editable. I would assume the username field is a “textbox” type. In edit.php, you should be able to just filter out the username field and not create a form “textbox” HTML element. So, in member/single/profile/edit.php around line 21, add in a check something like:
<?php if ( 'username' == bp_get_the_profile_field_name() ) : ?>
// Just display the Username with bp_the_profile_field_name() and add HTML to style how you want.
<?php else : ?>
// Do the existing <label... code on line 23 and 24
<?php endif; ?>
Now, a creative user might still be able to circumvent your little hack and submit their change directly to the form. I see a nonce being used though in the form so that might not be too much of a concern after all.