English (United Kingdom)

do_action( 'vikrestaurants_before_query_conditional_texts', mixed &$query )

Fires while retrieving the available conditional texts to use for the notification e-mails.


Description 

The system uses the conditional texts to extend the mailing information according to specific conditions.

It is possible to use this hook to manually alter the query used to fetch them from the database.


Parameters

&$query

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


Example

The example below automatically excludes all the unpublished conditional texts. Since the conditional texts don't support a column to check whether they are published or not, it is assumed that such a column is manually added by altering the database table.

/**
 * Trigger hook to allow external plugins to manipulate the query used
 * to load the conditional texts through this helper class.
 *
 * @param  mixed  &$query  A query builder object.
 *
 * @since  1.3
 */
add_action('vikrestaurants_before_query_conditional_texts', function(&$query) {
    // It is assumed that the database table has been altered accordingly:
    // ALTER TABLE `#__vikrestaurants_mail_text`
    // ADD COLUMN `published` tinyint(1) DEFAULT 1;

    // take only the published conditional texts
    $query->where('m.published = 1');
});

Changelog

Version Description
1.3 Introduced.
Last Update: 2023-12-20
Helpful?
See Also:

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.