Search Documentation

WP Travel Developer Documentation

  1. Home
  2. Docs
  3. WP Travel Developer Documentation
  4. Action Hooks
  5. Action :wp_travel_after_booking_data_save

Action :wp_travel_after_booking_data_save

Fires after updating and saving data of order items. Currently using for updating payment status.

Active Since v2.0.0

Source

File: /inc/booking-functions.php
Used by: /inc/booking-functions.php

Parameters
$booking_id

Example:

function prefix_wp_travel_after_booking_data_save( $booking_id ) {
    if ( ! $booking_id ) {
        return;
    }
    $payment_id = wp_travel_get_payment_id( $booking_id );

    if ( $payment_id ) {
        $payment_status = isset( $_POST['wp_travel_payment_status'] ) ? $_POST['wp_travel_payment_status'] : 'N/A';
        update_post_meta( $payment_id, 'wp_travel_payment_status', $payment_status );
    }

}
add_action( 'wp_travel_after_booking_data_save', 'prefix_wp_travel_after_booking_data_save'  );
Was this article helpful to you? Yes No

How can we help?