Email as Username

hello! I’m attempting to implement some code that was suggested on the s2member site (https://s2member.com/kb-article/using-the-e-mail-address-as-the-username/). The first code suggestion works…The 2nd part works, but only partially. when I register with the email "august_23_99@yahoo.com" I get an email saying “Username: august_23_99696” and on 2nd attempt I got “Username: august_23_99977”.

I suppose this is close enough? but I would really like it to match the actual email address, instead of a variation. Is this possible?

Thanks much!

That code is working as expected. Despite the page title, that example is described as “An idea about how this might work” and is precisely about replacing the email domain with a random three-digit number so that it creates (almost) unique usernames.

You will need to modify the code if you actually want to replicate emails as usernames. But do you really need this anyway? That code was written a few years ago. Since then, WordPress has changed so that it now allows users to login with their email address instead of their username.

Ok thats pretty much what I figured.
wp does allow that now? What!? how could I have missed that!? Thanks for the heads up.