Hooks/admin append to users form

admin_append_to_users_form

arguments: $user User

location: at the end of the admin users form (users/form.php)

Pro Tip

If you are looking up any information about the user, wrap the operations in an if statement like so:

if($user->id) {
    //your operations and output
}

This is necessary because the admin view of users includes a form to add a user, which includes a new User object. Because it is new, it does not yet exist in the database. The result is that if your plugin tries to do any operations on it, it throws a database error. Checking for $user->id ensures that the user exists in the database first.