I am using WordPress 4.9.4 in a WordPress Multisite, and I need to allow users to register using their email address as username.
Looking at the code I found that what prevents me from accomplish that is that in the ms-functions.php there is a regular expression filtering usernames that have other characters than a-z, so when an email is the username I would get “Usernames can only contain lowercase letters (a-z) and numbers.”
I changed that regular expression in the ms-functions.php and it works fine. Now my question is, I don’t want to have to recode the function wpmu_validate_user_signup every time I update my wordpress. What would be good practices regarding this issue? Should I create another includes/ms-functions.php in a theme_child? If so, can I create only this function or I have to copy the entire ms-functions.php?
Thanks