Your cart is empty!
After Validate
apply_filters( 'vikappointments_after_validate_customer_subscription', bool $subscribed, mixed $customer, array $services, mixed $checkin )
Fires after checking whether a customer owns an active subscription.
Description
This hook can be used to apply additional conditions to the subscription validation.
When this hook triggers, the system already validated all the default conditions.
NOTE: calling $customer->isSubscribed()
would result in recursion.
Parameters
- $subscribed
-
(bool) True to flag the customer as subscribed, false to flag it as expired.
- $customer
-
(VAPCustomer) The object holding the customer details.
- $id
-
(array) A list of services to check.
- $checkin
-
(string) An optional check-in date (UTC).
Example
/**
* This hook can be used to apply additional conditions to the subscription validation.
* When this hook triggers, the system already validated all the default conditions.
*
* @param mixed $subscribed True to flag the customer as subscribed, false to flag it as expired.
* @param VAPCustomer $customer The customer details.
* @param array $services A list of services to check.
* @param mixed $checkin An optional check-in date (UTC).
*/
add_filter('vikappointments_after_validate_customer_subscription', function($subscribed, $customer, $id, $checkin)
{
/**
* @todo apply further conditions
*/
return $subscribed;
}, 10, 4);
Changelog
Version | Description |
---|---|
1.2 | Introduced. |
Last Update: 2021-08-23
Helpful?