public function setWordpressRoles(array $roles, $prefix = 'ROLE_WP_')
    {
        foreach ($roles as $key => $role) {
            $roles[$key] = $prefix.strtoupper($role);
        }

        $this->setRoles($roles);

        return $this;
    }
public function setWordpressRoles(array $roles, $prefix = 'ROLE_WP_')
    {
        foreach ($roles as $key => $role) {
            $roles[$key] = $prefix.strtoupper($role);
        }

        $this->setRoles($roles);

        return $this;
    }
public function setWordpressRoles ( array $ roles , $ prefix = 'ROLE_WP_' ) { foreach ( $ roles as $ key => $ role ) { $ roles [ $ key ] = $ prefix . strtoupper ( $ role ) ; } $ this -> setRoles ( $ roles ) ; return $ this ; }
Sets Wordpress user roles by prefixing them.

@param array  $roles  An array of roles
@param string $prefix A role prefix

@return User
Sets Wordpress user roles by prefixing them .