I need to know what the wp specifications for the usernames are. Like allowed minimum and maximum length, are special characters like ü,ö,ä,ß accepted,..?
Unfortunately I couldn't find any insight on this in the interweb. Do you have any?
I think the answer is in the source.
$username = wp_strip_all_tags( $username ); $username = remove_accents( $username ); // Kill octets $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username ); $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );
So, the code strips tags, octets, and html entities. And it replaces accented characters with unaccented ones via the
remove_accents function, which is fairly lengthy. Other characters get through unless
true (default is
false), in which case only ASCII characters are allowed.
The maximum login name length would be the database limit for the user_login column-- 60 characters. The minimum, as best I can tell, is 1.