mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
Revert remove role duplication issue
This commit is contained in:
@@ -158,24 +158,6 @@ if ( ! class_exists( 'Roles_Capabilities' ) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove user role
|
|
||||||
*
|
|
||||||
* @param $user_id
|
|
||||||
* @param $role
|
|
||||||
*/
|
|
||||||
function remove_role( $user_id, $role ) {
|
|
||||||
// Validate user id
|
|
||||||
$user = get_userdata( $user_id );
|
|
||||||
|
|
||||||
// User exists
|
|
||||||
if ( ! empty( $user ) ) {
|
|
||||||
// Remove role
|
|
||||||
$user->remove_role( $role );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set roles to user (remove all previous roles)
|
* Set roles to user (remove all previous roles)
|
||||||
* make user only with $roles roles
|
* make user only with $roles roles
|
||||||
|
|||||||
Reference in New Issue
Block a user