get_userdata()
returns you the data of a specific user (by id), while get_currentuserinfo()
returns data about the current logged in user.
For example, you could use get_currentuserinfo()
to welcome a user (e.g. “Welcome back John”), if he’s signed in.