Italian (Italy)
Knowledge Base  >  Vik Restaurants  >  Hooks  >  Campi  >  Load Rules

do_action_ref_array( 'vikrestaurants_load_custom_fields_rules', array &$rules )

Fires while loading the list of supported custom fields rules.


Description

Trigger hook to allow external plugins to support additional rules for the custom fields.

New rules have to be appended to the given associative array. The key of the array is the unique ID of the rule, the value is a readable name of the rule.

All the values included within the $rules array will be reported as accepted options of the Rule dropdown under the management page of a custom field.


Parameters

&$rules

(array)  An associative array holding all the supported rules.


Example

The example below adds support for a new rule that extracts the country code from the field.

/**
 * Trigger hook to allow external plugins to support custom rules.
 * New rules have to be appended to the given associative array.
 * The key of the array is the unique ID of the rule, the value is
 * a readable name of the rule.
 *
 * @param  array  &$rules  An array of rules.
 */
add_action('vikrestaurants_load_custom_fields_rules snippet', function(&$rules) {
    // add support for a new "country" rule
    $rules['country'] = 'Country';
});

Changelog

Version Description
1.3 Introduced.
Ultimo aggiornamento: 2024-01-03
Utile?
Potrebbe interessarti:

Questo sito web utilizza i cookie

Questo sito web utilizza cookie e tecnologie simili. Alcune di queste tecnologie sono necessarie per il corretto funzionamento del sito web (essenziali). Altre tecnologie sono utilizzate per valutare il comportamento degli utenti (analisi), per integrare media esterni o per scopi pubblicitari. Se l'utente accetta, queste tecnologie vengono attivate. I dettagli sono riportati nella Privacy Policy. Da questa stessa pagina è inoltre possibile aggiornare/revocare il consenso. Se non si fornisce il consenso, verranno attivati solo i cookie con funzioni essenziali.

Sul nostro sito web utilizziamo tecnologie provenienti dagli Stati Uniti. Pertanto, se acconsentite, acconsentite anche al trasferimento dei vostri dati negli Stati Uniti. Desideriamo sottolineare che gli Stati Uniti non hanno un livello di protezione dei dati paragonabile a quello dell'Unione Europea e che qualsiasi azienda statunitense può essere obbligata dalle autorità statali a consegnare i vostri dati senza che voi abbiate alcuno strumento efficace di protezione legale contro questo.