Codex tools: Log in / create account
Contents |
Returns an object with the information pertaining to the user whose ID is passed to it. Properties map directly to wp_users table in the database (see Database Description).
<?php get_userdata(userid); ?>
The call to get_userdata() returns the user's data, where it can be retrieved using member variables.
<?php $user_info = get_userdata(1);
echo('Username: ' . $user_info->user_login . "\n");
echo('User level: ' . $user_info->user_level . "\n");
echo('User ID: ' . $user_info->ID . "\n");
?>
<?php $user_info = get_userdata(1);
echo($user_info->last_name . ", " . $user_info->first_name . "\n");
?>
Blow, Joe
Here are the values in the users table you can access via this function: