wordpress current user username code example
Example 1: wordpress get username
$current_user = wp_get_current_user();
echo($current_user->user_login);
Example 2: wordpress get user by id
$user_obj = get_user_by('id', 1);
$current_user = wp_get_current_user();
echo($current_user->user_login);
$user_obj = get_user_by('id', 1);