Strip non-alphanumeric characters from generated usernames
-
Found the answer and figured I would share.
Go to roughly line 354 or so and find this code block…
$uarray = split( '@', $user['email'] ); $user['username'] = sanitize_user( $uarray[0] );
Now change it to this…
$uarray = split( '@', $user['email'] ); $uarray = preg_replace("/[^a-zA-Z0-9\s]/", "", $uarray); $user['username'] = sanitize_user( $uarray[0] );
That’s it.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Strip non-alphanumeric characters from generated usernames’ is closed to new replies.