Hi there,
I was trying to install the following snippet in the functions.php of the ExpertHive Theme, but it broke my site. Where is the correct location for this?
//Update booking
add_action(
'hivepress/v1/models/booking/update_status',
function( $booking_id, $new_status, $old_status, $booking , $listing) {
// Check status.
if ( 'publish' !== $new_status ) {
return;
}
// Send request.
wp_remote_post(
'https://hooks.zapier.com/hooks/catch/195018/3qhudlg',
[
'body' => [
'booking_start_time' => date('Y-m-d', $booking->get_start_time());
'booking_end_time' => date('Y-m-d', $booking->get_end_time());
'booking_client' => $booking->get_user__id(),
'booking_consultant' => $listing->get_user__id(),
'booking_order' => $order_id,
],
]
);
},
1000,
4
);