Methods

hooks()

hooks() : mixed

Returns

mixed

map_caps_by_role()

map_caps_by_role(bool[]  $allcaps, string[]  $caps, array  $args) : bool[]

Restrict the edit/delete users via wp-admin screen due UM role capabilities

Parameters

bool[] $allcaps

Array of key/value pairs where keys represent a capability name and boolean values represent whether the user has that capability.

string[] $caps

Required primitive capabilities for the requested capability.

array $args

{ Arguments that accompany the requested capability check.

@type string $0 Requested capability.
@type int    $1 Concerned user ID.
@type mixed  ...$2 Optional second and further parameters, typically object ID.

}

Returns

bool[]

restrict_roles()

restrict_roles(array  $roles) : array

Hide role filters with not accessible roles

Parameters

array $roles

Returns

array

statuses_list()

statuses_list() : array

Get the user statuses list.

Returns

array

set_status()

set_status(int  $user_id, string  $status) : bool

Set user's account status.

Parameters

int $user_id

User ID.

string $status

Status key.

Returns

bool

get_status()

get_status(int  $user_id, mixed  $format = 'raw') : string

Get user account status.

Parameters

int $user_id

User ID

mixed $format

Returns

string

has_status()

has_status(int  $user_id, string  $status_control) : bool

Check if user has selected account status.

Parameters

int $user_id

User ID.

string $status_control

Status key.

Returns

bool

remove_cache()

remove_cache(int  $user_id) : mixed

Reset User cache

Parameters

int $user_id

User ID.

Returns

mixed

reset_activation_link()

reset_activation_link(int  $user_id) : mixed

Reset Activation link hash.

Parameters

int $user_id

User ID.

Returns

mixed

assign_secretkey()

assign_secretkey(int  $user_id) : mixed

Set user's activation link hash

Parameters

int $user_id

User ID.

Returns

mixed

maybe_generate_password_reset_key()

maybe_generate_password_reset_key(\WP_User  $userdata) : string|\WP_Error

Parameters

\WP_User $userdata

Returns

string|\WP_Error

can_current_user_edit_user()

can_current_user_edit_user(int  $user_id) : bool

Parameters

int $user_id

Returns

bool

can_activation_send()

can_activation_send(int  $user_id, bool  $force = false) : bool

Activation can be sent everytime for every user. Even force for current user.

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool

send_activation()

send_activation(int  $user_id, bool  $force = false) : bool

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool

can_be_deactivated()

can_be_deactivated(int  $user_id) : bool

Parameters

int $user_id

User ID.

Returns

bool

deactivate()

deactivate(int  $user_id) : bool

Parameters

int $user_id

User ID.

Returns

bool

can_be_rejected()

can_be_rejected(int  $user_id) : bool

User can be rejected only after awaiting admin review status.

Parameters

int $user_id

User ID.

Returns

bool

reject()

reject(int  $user_id) : bool

Reject user membership.

Parameters

int $user_id

User ID.

Returns

bool

can_be_set_as_pending()

can_be_set_as_pending(int  $user_id, bool  $force = false) : bool

Check if the user can be set as pending admin review. Cannot set the same status but any user can be set to pending admin review.

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool

set_as_pending()

set_as_pending(int  $user_id, bool  $force = false) : bool

Set user as pending admin review.

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool

can_be_approved()

can_be_approved(int  $user_id, bool  $force = false) : bool

Check if the user can be approved. Any user with status that isn't equal to `approved` can be approved.

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool

approve()

approve(int  $user_id, bool  $force = false) : bool

Approve user.

Parameters

int $user_id

User ID.

bool $force

If true - ignore current user condition.

Returns

bool —

true if the user has been approved false on failure or if the user already has approved status.

can_be_reactivated()

can_be_reactivated(int  $user_id) : bool

Reactivated can be only `inactive` user.

Parameters

int $user_id

User ID.

Returns

bool

reactivate()

reactivate(int  $user_id) : bool

Reactivate user.

Parameters

int $user_id

User ID.

Returns

bool —

true if the user has been reactivated false on failure or if the user already has approved status.

user_exists()

user_exists(int  $user_id) : bool

Parameters

int $user_id

Returns

bool

destroy_all_sessions()

destroy_all_sessions(int  $user_id) : void

Clear all sessions for user ID.

Parameters

int $user_id

User ID.