Hey! for BP 6.1 :
Lous thinking!
Working on the same problem. Maybe try this advice. The problem is; you cant send private not-friend-messages or mentions or scale up to blog-user-based systems with whitepaced usernames. In the end the user gonna need to enter no-whitepace-names. So interacting nicely would be better approach:
1) To accept the user to type whitespace, but not record them, using jQuery
2) Use EMAIL also to login https://wordpress.org/extend/plugins/wp-email-login/
Example for 1) :
– Leave the register process AS IT IS in bp 6.1 -as now accepts:
Donald Duck = donAld duCK = or HOWEVER a user choose their username with lowercase/ uppercase (This is good for loggin back in – many forgot their cases). The username avabililty checker don alows any other combinations either by default (DonaLD-DUCK is occupied).
– Run a jQuery on(‘keyup’) function as a validator when form appears at :
a) register
b) Loggin in
c) Changing username (if enabled by any plugin)
d)* Display name (xprofile required field) = profile edit BASE submit
OBS : The keyup replaces any whitepsace on the fly when user typing in their Username with hyphens. Diffrent browser handle this diffrent, so a onfocus need to be provided if user PASTE their name. NOTE : YES The user with no javascript has to look at the instructions instead …
The results will become : “Donald-Duck” as username, loggin in however letters cased.
If you don wanna show this white-space replacement, Use ‘onsubmit’ instead of keyup -so it can be added silent. But I think its better to LEARN the user to use Hypens – by see the “forced action”. The user will need to write correct usernames when sending/ composing messages and mentions and feeds and…if you scale up.
GOOD: “donald-duck” as the sitewide username = key (private messages, mentions and slugs for blogfarms etc etc)
Also – for user exp – Use a tooltip to make it CLEAR that we are replacing their favorite username with hyphens.
* Display name field, change in the template to ‘hidden’ in xprofile situations. Menaing: NEVER let the user be avaible to fill that out. So the trick comes to the register process. This field is hardcoded required. Let the field be hidden by CSS, added a clone of Username field in the submit. Let the username be Masterfield so avabililty check running ok. Then you get rid of Display name showing SAME for diffrent users – if they can type by themselfs.
Special if you dont wanna display/ using First and Last names:
I have hidden the Display name field in register/ everywhere, cloning username data on Submit, splitting hypens so it displays Donald Duck.
In the payment forms Firstname = Donald Last name = Duck
OTHERWISE the first name will be Donald-Duck and last name Empty.
Summary:
Don mess with php tweaks so urls get crazy, you loose quality of your collected database if ya cant scale up or migrate in the future. I tried everything and belive me, a small site will starting have problems very soon. Don core files, its security reasons why no filtering is easy to do here – I suppose, after trying everything with authenticate filters and hooks.
I woluld like a plugin to Change ALL custom messages provided in the sign up processes in WP. Including The boring email without username provided. The Welcome Pack can do this with some trix. So the user-name is shown in confirm message.
/ Hope it helps.