Where can I find documentation on what characters are allowed in user names and why?

You can use spaces in usernames, no problem. Several users on wordpress.org have spaces in their usernames. Strict mode only allows these characters: a-z0-9<space>_.\-@ However WP doesn’t default to strict mode. Now, multisite has different restrictions, and it may strip spaces there. This is because usernames are used to create independent blogs and such on … Read more

How do I display logged-in username IF logged-in?

This seems to do what you need. <?php global $current_user; wp_get_current_user(); ?> <?php if ( is_user_logged_in() ) { echo ‘Username: ‘ . $current_user->user_login . “\n”; echo ‘User display name: ‘ . $current_user->display_name . “\n”; } else { wp_loginout(); } ?>