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', // Month/Date	
		'05/15'
	);
	return $excluded_dates;
} );