Italian (Italy)
Knowledge Base  >  Vik Appointments  >  Hook  >  Recensione  >  Validate Leave

apply_filters( 'vikappointments_validate_leave_review', bool $allow, string $type, int $id, object $user )

Fires while checking whether the user is allowed to leave a review.


Description

Trigger hook to override the default system criteria used to evaluate whether a review should be left or not.

In case of the hook returns a positive value, the user will be allowed to leave a review. Otherwise, the system will fallback on the default validation criteria.


Parameters

$allow

(bool)  Use true to allow the user to leave a review.

$type

(string)  The entity type for which the user wants to leave a review (service or employee).

$id

(int)  The entity ID for which the review should be left.

$user

(object)  An object holding the details of the currently logged in user, if any.


Example

The example below is used to always allow the users to leave a review, even if they already left a review for the same entity.

/**
 * Trigger event to override the default system criteria used to
 * validate whether a review should be left or not.
 *
 * @param  boolean  $allow  True if the review should be left.
 * @param  string   $type   The entity type (service or employee).
 * @param  integer  $id     The entity ID for which the review should be left.
 * @param  JUser    $user   The current user object.
 */
add_filter('vikappointments_validate_leave_review', function($allow, $type, $id, $user)
{
    return true;
}, 10, 4);

Changelog

Version Description
1.0 Introduced.
Ultimo aggiornamento: 2021-10-04
Utile?

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.