1
0
Fork 0
mirror of synced 2025-04-06 07:13:33 +03:00

Add selection of client roles: fix undefined prop error

This commit is contained in:
Бараников Максим 2020-08-10 09:27:23 +03:00
parent 3db915637b
commit 3ee2eed974

View file

@ -637,7 +637,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
$userRoles = $user->roles;
} elseif ($user instanceof WC_Customer) {
$wpUser = get_user_by('id', $user->get_id());
$userRoles = $wpUser->roles;
$userRoles = ($wpUser) ? $wpUser->roles : array($user->get_role());
} else {
return false;
}