WordPress at a glance
function is not described

wc_user_has_role() WC 1.0

Checks if a user has a role.

No Hooks.

Return

true|false. Nothing.

Usage

wc_user_has_role( $user, $role );
$user(int|\WP_User) (required)
The user.
$role(string) (required)
The role.

Code of wc_user_has_role() WC 5.2.2

<?php
function wc_user_has_role( $user, $role ) {
	if ( ! is_object( $user ) ) {
		$user = get_userdata( $user );
	}

	if ( ! $user || ! $user->exists() ) {
		return false;
	}

	return in_array( $role, $user->roles, true );
}