\um\coreRoles_Capabilities

Class Roles_Capabilities

Summary

Methods
Properties
Constants
__construct()
um_roles_init()
is_role_custom()
set_role()
remove_role()
set_roles()
um_get_user_role()
get_all_user_roles()
get_priority_user_role()
get_editable_user_roles()
get_editable_priority_user_role()
get_um_user_role()
get_role_name()
role_data()
get_roles()
um_current_user_can()
um_user_can()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Roles_Capabilities constructor.

um_roles_init()

um_roles_init(null|object  $wp_roles = null) : null

Loop through dynamic roles and add them to the $wp_roles array

Parameters

null|object $wp_roles

Returns

null

is_role_custom()

is_role_custom(  $role) : boolean

Check if role is custom

Parameters

$role

Returns

boolean

set_role()

set_role(integer  $user_id, string  $new_role = '') : string

Return a user's main role

Parameters

integer $user_id
string $new_role

Returns

string

remove_role()

remove_role(  $user_id,   $role) 

Remove user role

Parameters

$user_id
$role

set_roles()

set_roles(integer  $user_id, string|array  $roles) 

Set roles to user (remove all previous roles) make user only with $roles roles

Parameters

integer $user_id
string|array $roles

um_get_user_role()

um_get_user_role(integer  $user_id) : boolean|mixed

Get user one of UM roles if it has it

Parameters

integer $user_id

Returns

boolean|mixed

get_all_user_roles()

get_all_user_roles(  $user_id) : array|boolean

Parameters

$user_id

Returns

array|boolean

get_priority_user_role()

get_priority_user_role(  $user_id) : boolean|mixed

Parameters

$user_id

Returns

boolean|mixed

get_editable_user_roles()

get_editable_user_roles() : array

Returns

array

get_editable_priority_user_role()

get_editable_priority_user_role(  $user_id) : boolean|mixed

Parameters

$user_id

Returns

boolean|mixed

get_um_user_role()

get_um_user_role(  $user_id) : boolean|mixed

Parameters

$user_id

Returns

boolean|mixed

get_role_name()

get_role_name(  $slug) : boolean|string

Get role name by roleID

Parameters

$slug

Returns

boolean|string

role_data()

role_data(integer  $roleID) : mixed|void

Get role data

Parameters

integer $roleID

Role ID

Returns

mixed|void

get_roles()

get_roles(boolean  $add_default = false, null  $exclude = null) : array

Query for UM roles

Parameters

boolean $add_default
null $exclude

Returns

array

um_current_user_can()

um_current_user_can(  $cap,   $user_id) : boolean|integer

Current user can

Parameters

$cap
$user_id

Returns

boolean|integer

um_user_can()

um_user_can(  $permission) : boolean|mixed

User can ( role settings )

Parameters

$permission

Returns

boolean|mixed