Reply To: User name as a variable
Hi @rayray23,
Since nobody seems to be replying to this … I’m definitely no expert, but I think it’s possible you might want something like:
if (is_user_logged_in()) {
$user = wp_get_current_user();
$username = $user->user_login;
I personally find it hard to search the WP documentation, but there should be information in:
https://developer.wordpress.org/reference/functions
Hope that’s helpful,
Mike