In this document:
Description
WordPress hook that fires once a booked appointment is canceled. The key it’s watching is the status.
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_canceled_hook() function in class-hooks.php.
Usage for ssa/appointment/canceled Hook
add_action('ssa/appointment/canceled', 'new_function_name', 10, 4);
Parameters
$appointment_id int
The ID of the newly canceled appointment.
$data_after array
The data of the appointment after it is canceled, which includes several keys as discussed in ssa/appointment/booked.
$data_before array
The appointment data before it was canceled includes several keys, as discussed in ssa/appointment/booked.
$response
The response of canceling the appointment.
Example – Alert Appointment Canceled
add_action('ssa/appointment/canceled', 'alert_appointment_canceled', 10, 4);
function alert_appointment_canceled($appointment_id, $data_after, $data_before, $response)
{
echo "The appointment with ID: $appointment_id on $data_after[start_date] is now canceled.";
}
Related Guides
-
MemberPress Appointments for Memberships
-
Appointments Tab for Member Dashboards
-
ssa/appointments/customer_information/get_defaults Filter
-
ssa/templates/get_template_vars Filter
