PHP Class Themosis\User\User

Inheritance: extends WP_Use\WP_User
Datei anzeigen Open project: themosis/framework Class Usage Examples

Public Methods

Method Description
can ( string $cap ) : boolean Check if the user can do a defined capability.
hasRole ( string $role ) : boolean Check if the user has role.
setRole ( string $role ) : User Set User role.
update ( array $userdata ) : User | WP_Error Update the user properties.

Method Details

can() public method

Check if the user can do a defined capability.
public can ( string $cap ) : boolean
$cap string
return boolean

hasRole() public method

Check if the user has role.
public hasRole ( string $role ) : boolean
$role string
return boolean

setRole() public method

Set User role.
public setRole ( string $role ) : User
$role string
return User

update() public method

Update the user properties.
public update ( array $userdata ) : User | WP_Error
$userdata array
return User | WP_Error