English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Service  >  Check Service 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: 2025-02-11
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.