Not sure what is going wrong, but when I use the following code I am able to add a role to a specific user, however, I am not able to remove a role using the remove_role command.
Any ideas?
I can add a role using the following code:
global $user_ID;
$user = new WP_User($user_ID);
$user->add_role('some_role_name');
But this does not remove the role:
$user->remove_role('some_role_name');
I'm checking what roles are associated to the user using the following code:
foreach ($user->roles as $role) {
echo "HAS ROLE: $role<br />";
}