Italian (Italy)
Knowledge Base  >  Vik Appointments  >  Hook  >  Appuntamenti  >  Cambio di Stato

apply_filters( 'vikappointments_status_change_reservation', bool $status, object $data )

Fires every time the status of an appointment changes.

It is possible to use the following code to access the details of the changed appointment.

VAPLoader::import('libraries.order.factory');
$order = VAPOrderFactory::getAppointments($data->id_order);

Description

Trigger hook to let the plugins be notified every time the status of the reservations change.


Parameters

$status

(bool)  True on success, false on failure.

$data

(object)  The object holding the details of the new status.


Example

/**
 * Trigger event to let the plugins be notified every time the status of the orders change.
 *
 * @param  boolean  $status  True on success, false on failure.
 * @param  object   $data    The order status details.
 */
add_filter('vikappointments_status_change_reservation', function($status, $data)
{
    /**
     * @todo do stuff when the status changes
     */

    return $status;
}, 10, 2);

Changelog

Version Description
1.1.8 Introduced.
Ultimo aggiornamento: 2021-08-23
Utile?
This site uses cookies. By continuing to browse you accept their use. Further information