In this document:
Description
WordPress hook that fires once there is a change to the booked appointment. The keys that are watched are:
appointment_type_id
author_id
customer_id
customer_information
start_date
end_date
title
description
price_full
payment_received
status
We offer another hook focusing on when an edit is done specifically to the customer information.
Placement
This code should be placed in the file of your custom plugin.
Source Code
This action is located in the SSA_Hooks::maybe_do_appointment_edited_hook()
function in class-hooks.php.
Usage for ssa/appointment/edited
add_action('ssa/appointment/edited', 'new_function_name', 10, 4);
Parameters
$appointment_id int
The ID of the newly edited appointment.
$data_after array
The changed data of the booked appointment, which includes several keys as discussed in ssa/appointment/booked.
$data_before array
The data of the booked appointment before the changes, which includes several keys as discussed in ssa/appointment/booked.
$response
The response of editing the appointment.
Example – Show an Alert when an Appointment is Edited
add_action('ssa/appointment/edited', 'alert_appointment_edited', 10, 4);
function alert_appointment_edited($appointment_id, $data_after, $data_before, $response)
{
echo "The appointment with ID: $appointment_id is now starting on $data_before[start_date] instead of $data_after[start_date]";
}
Related Guides
-
Developer Settings
-
New Booking App
-
ssa/appointments/customer_information/get_defaults Filter
-
ssa/templates/get_template_vars Filter