English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Service  >  Check Employee Visibility

apply_filters( 'vikappointments_check_service_visibility', bool $show, object $service, string $date )

Fires while checking whether a service is published or not.


Description 

This hook can be used to apply additional conditions while checking whether the specified service is published or not.

When this hook is triggered, the system already validated the standard conditions and the service is going to be used by the website.


Parameters

$show

(bool)  False to hide the service.

$service

(object)  The service to check. 

$date

(string)  The UTC check-in date in military format (Y-m-d H:i:s).


Example

/**
 * This hook can be used to apply additional conditions while checking whether
 * the specified service is published or not. When this hook is triggered, the
 * system already validated the standard conditions and the service is going
 * to be used by the website.
 *
 * @param  boolean  $show     False to hide the service.
 * @param  object   $service  The service to check.
 * @param  string   $date     The check-in date (UTC).
 */
add_filter('vikappointments_check_service_visibility', function($show, $service, $date)
{
    /**
     * @todo apply some custom validations
     */

    return $show;
}, 10, 3);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-08-12
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information