View Categories

Filters Associated With Date

Filter: wp_travel_js_date_format #

WP Travel JavaScript date format.

Active Since v1.6.7

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$js_date_format

Example:

function prefix_wp_travel_js_date_format( $js_date_format ) {
    $js_date_format = โ€˜DATE FORMATโ€™;
    return $js_date_format;
}
add_filter( 'wp_travel_js_date_format', 'prefix_wp_travel_js_date_format' );

Filter: wp_travel_moment_date_format #

WP Travel date format for moment.

Active Since v1.7.6

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$js_date_format

Example:

function prefix_wp_travel_moment_date_format( $js_date_format ) {
    $js_date_format = โ€˜DATE FORMATโ€™;
    return $js_date_format;
}
add_filter( 'wp_travel_moment_date_format', 'prefix_wp_travel_moment_date_format' );

Filter: wp_travel_booking_travel_date #

WP Travel booking arrival or travel date.

Active Since v3.1.3

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$travel_date, $order_detail

Example:

function prefix_wp_travel_booking_travel_date( $travel_date, $order_detail ) {
    $travel_date = โ€˜DATEโ€™;
    return $travel_date;
}
add_filter( 'wp_travel_booking_travel_date', 'prefix_wp_travel_booking_travel_date', 12, 2 );

Filter: wp_travel_show_multiple_fixed_departure_dates #

WP Travel multiple fixed departure dates show or not.

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
Default is false.

Example:

function prefix_wp_travel_show_multiple_fixed_departure_dates() {
    return true;
}
add_filter( 'wp_travel_show_multiple_fixed_departure_dates', 'prefix_wp_travel_show_multiple_fixed_departure_dates' );

Filter: wptravel_trip_dates #

This filter is used to modify trip dates of specific trip or all trips.

Source

File: wp-travel/core/helpers/trip-dates.php

Parameters
$dates, $trip_id

Example:

add_filter( 'wptravel_trip_dates', function( $dates, $trip_id ) {
	// Your customized Dates array here. 
    // Note: Only fixed departure date will work here.
	return $dates;
}, 10, 2 );

Filter: wp_travel_booking_mail_departure #

This filter is used to change the label of the departure date

add_filter('wp_travel_booking_mail_departure',function(){
		return esc_html( 'Start Date', 'wp-travel' );
	}
);

Filter: wp_travel_booking_mail_arrival #

This filter is used to change the label of the Arrival date

add_filter('wp_travel_booking_mail_arrival', function(){
		return esc_html( 'End Date', 'wp-travel' );
	}
);

Filter: wptravel_exclude_booking_dates #

This filter is used to exclude the dates from booking for all trips

add_filter( 'wptravel_exclude_booking_dates', function( $excluded_dates ){
	$excluded_dates = array(
		'05/01/2024', // Month/Date/Year	
		'05/15/2025'
	);
	return $excluded_dates;
} );

Learn More: How To Add Exclude Dates For All The Trips

Filter: wp_travel_enable_booking_reserve_date #

To block all Trips for a Specific Date

add_filter( 'wp_travel_enable_booking_reserve_date', function(){ 
  return true; 
} );

To block Specific Trips for a Specific Date

add_filter('wp_travel_enable_booking_reserve_date', function() {
    return true;
});

add_filter('wp_travel_enable_booking_reserve_date_all_trips', function() {
    return false;
});

Learn More: To Block Multiple Bookings for a Reserved Date

Filter: wp_travel_email_departure_time_label #

This filter is used to change the Label of time in email

add_filter( 'wp_travel_email_departure_time_label', function(){
  return 'Pick up Time: ';
} );

Filter: wptravel_show_trip_start_and_end_date #

This filter is used to display the tripโ€™s start and end dates on a single trip page

add_filter( 'wptravel_show_trip_start_and_end_date', function(){
    return true;
} );

Filter: wp_travel_enable_arrival_date_on_checkout #

This filter is used to display the tripโ€™s start and end dates on the checkout page mini cart

add_filter('wp_travel_enable_arrival_date_on_checkout', function(){
	return true;
});

Filter: wptravel_exclude_booking_dates_range_for_all_trips #

Block Bookings for a Single Date Range

add_filter( 'wptravel_exclude_booking_dates_range_for_all_trips', function () {
    return array(
        array(
            '03/25/2026', // start date
            '03/29/2026'  // end date
        ),
    );
});

Block Bookings for a Single Date Range

add_filter( 'wptravel_exclude_booking_dates_range_for_all_trips', function () {
    return array(
        array(
            '03/25/2026', // start date
            '03/29/2026'  // end date
        ),
        array(
            '04/05/2026', // start date
            '04/07/2026'  // end date
        ),
        array(
            '04/25/2026', // start date
            '04/27/2026'  // end date
        ),
    );
});

Filter: wp_travel_label_for_no_trip_date #

This filter allows you to customize the โ€œNo Date Availableโ€ label displayed when a trip has no available dates.

add_filter( 'wp_travel_label_for_no_trip_date', function(){
       return 'No Date Avialable';
} );