I created a module and I need to use the user name of the user's profile being viewed.
How do I call/get it?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can load a user object like this :
$current_user = menu_get_object('user', 1); $username = $current_user->name;
Reference of menu_get_object function.