Filters Associated With Booking

Filter : wp_travel_booking_show_end_date #

This filter helps to remove the end date.

Source

File : /inc/helpers.php

Used by
/inc/helpers.php

Example :

function wp_travel_remove_dates (){
    return false;
}

add_filter('wp_travel_booking_show_end_date','wp_travel_remove_dates');

Filter: wp_travel_booking_post_id_to_update #

Booking ID to update data.

Source

File: /inc/booking-functions.php
Used by: /inc/booking-functions.php, /inc/trip-enquiries.php

Parameters
$booking_id, $key, $field[‘name’]

Example:

function prefix_wp_travel_booking_post_id_to_update( $booking_id, $key, $field_name ) {
    $booking_id = ‘BOOKING ID’;
    return $booking_id;
}
add_filter( 'wp_travel_booking_post_id_to_update', 'prefix_wp_travel_booking_post_id_to_update', 12, 3 );

Filter: wp_travel_booking_form_fields #

WP Travel booking form fields.

Deprecated From v4.3.5

Source

File: /inc/deprecated/435.php
Used by: /inc/deprecated/435.php

Parameters
$booking_fields

Example:

function prefix_wp_travel_booking_form_fields( $booking_fields ) {
    $booking_fields[ ‘custom field’ ] = ‘value’;
    return $booking_fields;
}
add_filter( 'wp_travel_booking_form_fields', 'prefix_wp_travel_booking_form_fields' );

Filter: wptravel_booking_offset #

Since WP Travel v8.3.0

add_filter( 'wptravel_booking_offset', function() {
    return 2; // Change the value '2' to the desired offset in hours
} );

This filter can be used to specify the amount of time that must elapse before a booking can be made.