English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Mail  >  Custom Texts  >  Fetch Compatible

apply_filters_ref_array( 'vikappointments_fetch_compatible_mail_texts', bool $status, mixed &$query, mixed $order, array $options )

Fires while loading the custom texts to include within the e-mail.


Description

Trigger hook to allow the plugins to manipulate the query used to retrieve the available mail custom texts.

Third party plugins can extend the query by applying further conditions or selecting additional data.


Parameters

$status

(bool)  True on success, false otherwise.

&$query

(mixed)  Either a query builder object or a plain string.

$order

(VAPOrderAppointment)  An object holding the appointment(s) details.

$options

(array)  An array of options to filter the custom texts.

  • lang - the language tag to use;
  • file - the template file to look for;
  • id - either an ID or a list of custom texts;
  • default - true to load the default custom fields, false to use only the specified ID.

Example

/**
 * Trigger hook to allow the plugins to manipulate the query used to retrieve
 * the available mail custom texts.
 *
 * @param  boolean  $status   True on success, false otherwise.
 * @param  mixed    &$query   Either a query builder or a query string.
 * @param  mixed    $order    An object containing the order details.
 * @param  array    $options  An array of options.
 */
add_filter('vikappointments_fetch_compatible_mail_texts', function($status, &$query, $order, $options)
{
    /**
     * @todo it is possible to manipulate here the query
     */

    return true;
}, 10, 4);

Changelog

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