The $user API variable is a type of page representing the current user, and the User class is Page type used for all users.
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the User
class also inherits all the methods and properties of: Page, WireData and Wire.
Common
Name | Return | Summary | |
---|---|---|---|
$user->admin_theme | string | Admin theme class name (when applicable). | |
$user->email | string | Get or set email address for this user. | |
$user->get() $user->get(string $key) $user->get(string $key) | null mixed | Get value | |
$user->pass | string Password | Set the user’s password. | |
$user->roles | PageArray | Get the roles this user has. |
Access
Languages
Name | Return | Summary | |
---|---|---|---|
$user->language | Language | User language, applicable only if LanguageSupport installed. | |
$user->setLanguage() $user->setLanguage($language) $user->setLanguage($language) | self | Set language for user (quietly) |
Additional methods and properties
In addition to the methods and properties above, User also inherits the methods and properties of these classes:
API reference based on ProcessWire core version 3.0.236