How To Get Display Name In WordPress

<?php
 $user_info = get_userdata(1);
 echo 'Username: ' . $user_info->user_login . "n";
 echo 'User roles: ' . implode(', ', $user_info->roles) . "n";
 echo 'User ID: ' . $user_info->ID . "n";
?>

Leave a Comment