public function setRol($rol)
    {
        if (in_array($rol, self::getAllowedRoles())) {
            $u = new \WP_User($this->ID);
            $u->set_role($rol);
            return true;
        }
        return false;
    }
public function setRol($rol)
    {
        if (in_array($rol, self::getAllowedRoles())) {
            $u = new \WP_User($this->ID);
            $u->set_role($rol);
            return true;
        }
        return false;
    }
public function setRol ( $ rol ) { if ( in_array ( $ rol , self :: getAllowedRoles ( ) ) ) { $ u = new \ WP_User ( $ this -> ID ) ; $ u -> set_role ( $ rol ) ; return true ; } return false ; }
Set a rol to User

@param string $rol
Set a rol to User