function est_intercept_ipn() { $data = wp_parse_args($_POST['custom']); $data['_est_email'] = $_POST['payer_email']; $details = array('_est_name' => $data['n'], '_est_email' => $_POST['e'], '_est_phone' => $data['p']); $booking = new BonsaiBooking($data['_est_property_id'], $data['_est_guests'], $data['_est_start'], $data['_est_end'], $details); if (!empty($_POST['e'])) { $_POST['_est_email'] = $_POST['e']; } $booking_id = $booking->insertBooking($_POST); est_send_booking_emails($booking_id, $data); }