In
function hook_user($op, &$edit, &$account, $category NULL)

It is said that most times they are the same, but not always. Then, in what case would the $account parameter be different from the global $user object? Any specific example?

Thanks,

Comments

nevets’s picture

The global $user is always the person logged in. The $account parameter of hook_user() is the user who the op is being applied to, for example when you view someone else's profile page $user is you, $account is the person being viewed.

biosv’s picture

Thanks for quick, and, yes, very clear and easy to understand answer!