Function: get_userdata

get_userdata( integer $user_id )

Retrieve user info by user ID.

Parameters

Name Type(s) Default Value Description
$user_id integer

User ID

Returns

WP_User | false

WP_User object on success, false on failure.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.