View Categories

Filters Associated With Archive Page

Filter: wp_travel_archive_itineraries_col_per_row #

Source

File: /inc/template-functions.php

Used by
/inc/template-functions.php

Example :

function wp_travel_manage_column(){
return 4;
}
add_filter('wp_travel_archive_itineraries_col_per_row','wp_travel_manage_column');

Filter: wp_travel_default_view_mode #

Source

File: /inc/template-functions.php

Used by
/inc/template-functions.php

Example :

function wp_travel_view_mode(){
    return "grid";
}
add_filter('wp_travel_default_view_mode','wp_travel_view_mode');

Filter: wp_travel_itineraries_col_per_row #

WP Travel itineraries shortcode column per row filter.

Source

File: /inc/class-shortcode.php
Used by: /inc/class-shortcode.php

Parameters
The default is 2.

Example:

function prefix_wp_travel_itineraries_col_per_row() {
    return โ€˜3โ€™;
}
add_filter( 'wp_travel_itineraries_col_per_row', 'prefix_wp_travel_itineraries_col_per_row' );

Filter:wp_travel_itineraries_array #

WP Travel gets an itineraries array list.

Source

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

Parameters
$itineraries_array, $args

Example:

function prefix_wp_travel_itineraries_array( $itineraries_array, $args ) {
    $itineraries_array[โ€˜IDโ€™] = โ€˜SLUGโ€™;
    return $itineraries_array;
}
add_filter( 'wp_travel_itineraries_array', 'prefix_wp_travel_itineraries_array', 12, 2 );

Filter: wp_travel_itinerary_thumbnail_size #

WP Travel posts thumbnail size.

Active Since v1.0.0

Source

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

Parameters
$size

Example:

function prefix_wp_travel_itinerary_thumbnail_size( $size ) {
    $size = โ€˜smallโ€™;
    return $size;
}
add_filter( 'wp_travel_itinerary_thumbnail_size', 'prefix_wp_travel_itinerary_thumbnail_size' );

Filter: wp_travel_trip_archive_filter_by #

WP Travel trips achieve filters by listing type.

Source

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

Parameters
$list_type. The default is โ€˜defaultโ€™.

Example:

function prefix_wp_travel_trip_archive_filter_by( $list_type ) {
    $list_type = โ€˜LIST BY TYPEโ€™;
    return $list_type;
}
add_filter( 'wp_travel_trip_archive_filter_by', 'prefix_wp_travel_trip_archive_filter_by' );

Filter: wp_travel_max_num_pages #

Archive page maximum number of pages.

Active Since v1.0.4

Source

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

Parameters
The default is โ€˜ โ€™.

Example:

function prefix_wp_travel_max_num_pages() {
    return โ€˜2โ€™;
}
add_filter( 'wp_travel_max_num_pages', 'prefix_wp_travel_max_num_pages' );

Filter: wptravel_show_quick_view_option #

WP Travel Pro v7.9.0 has introduced a valuable enhancement that allows users to take a quick look at the trip details without visiting the single trip page.

Hook to enable the feature

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

Filter: wp_travel_list_trips_orders #

WP Travel Pro v9.7.0 introduces a new hook that allows you to list trips in ascending order or descending order

add_filter( 'wp_travel_list_trips_orders', function(){
        return 'desc'; // asc or desc
} );

Filter: wp_travel_archives_page_trip_group_size #

To display min-max pax on the Archive page #

function wp_travel_custom_archives_page_trip_group_size( $group_size, $trip_id ) {
    $min = 0;
    $max = 0;
    foreach(  WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
        if( $min < $data['min_pax'] ){
            $min = $data['min_pax'];
        }
        if( $max < $data['max_pax'] ){
            $max = $data['max_pax'];
        }
    }
    return 'Min ' . $min . ' -  Max ' . $max; //Min and Max can be replaced
}
add_filter( 'wp_travel_archives_page_trip_group_size', 'wp_travel_custom_archives_page_trip_group_size', 10, 2 );

Display maximum size along with text on the Archive page #

function wp_travel_custom_archives_page_trip_group_size( $group_size, $trip_id ) {
    $min = 0;
    $max = 0;
    foreach(  WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
        if( $min < $data['min_pax'] ){
            $min = $data['min_pax'];
        }
        if( $max < $data['max_pax'] ){
            $max = $data['max_pax'];
        }
    }
    return   $max . ' maximum';//maximum can be renamed
}
add_filter( 'wp_travel_archives_page_trip_group_size', 'wp_travel_custom_archives_page_trip_group_size', 10, 2 );

Display Minimum size along with text on the Archive page #

function wp_travel_custom_archives_page_trip_group_size( $group_size, $trip_id ) {
    $min = 0;
    $max = 0;
    foreach(  WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
        if( $min < $data['min_pax'] ){
            $min = $data['min_pax'];
        }
        if( $max < $data['max_pax'] ){
            $max = $data['max_pax'];
        }
    }
    return   $min . ' min'; //man can be renamed
}
add_filter( 'wp_travel_archives_page_trip_group_size', 'wp_travel_custom_archives_page_trip_group_size', 10, 2 );


Filter: wptravel_hide_empty_taxonomies_search_form #

This hook can be used to display empty taxonomies in the filter available on the archive page.

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

Filter: wp_travel_enable_quick_book #

The new update in WP Travel Pro v10.4.0 streamlines the booking processโ€”users can now secure their spot on a trip straight from the listing page, saving time and effort.

Hook to enable the feature

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