Filters Associated With Single Itinerary Page

Filter: wp_travel_show_single_page_title #

This filter allows you to remove the title of the trip if you don’t want it to display in the single trip page.

Source

File : /templates/content-single-itineraries.php

Used by
/templates/content-single-itineraries.php

Example :

function prefix_wp_travel_show_single_page_title( $show ) {
    return false; // This will hide the page title.
}
add_filter( 'wp_travel_show_single_page_title', 'prefix_wp_travel_show_single_page_title'  );

Filter: wp_travel_currency_symbols #

Source

File : /inc/currencies.php

Used by
/inc/currencies.php

Example :

add_filter( 'wp_travel_currency_symbols', function( $currency_symbols ) {
     $currency_symbols['USD'] = "Your Text";
    return $currency_symbols;
} );

Filter: wp_travel_itinerary_sale_price #

Source

File : /inc/helpers/helpers-price.php

Used by
/inc/helpers/helpers-price.php

Example :

function wp_travel_customize_sale_price_display( $s, $c, $d ) {
    if ( is_front_page() ) {
        return sprintf( esc_html__('From %1s %2s', 'wp-travel' ), $c , $d );
    }
    return $s;
}
add_filter( 'wp_travel_itinerary_sale_price', 'wp_travel_customize_sale_price_display', 99, 3 );

Filter: wp_travel_custom_itinerary_tabs #

Custom itinerary tabs enable/disable. Default is false.

Source

File: /core/ajax/trips.php
Used by: /core/ajax/trips.php, /core/helpers/trips.php, /inc/helpers.php. /inc/admin/views/tabs/tab-contents/itineraries/tabs.php

Example:

function prefix_wp_travel_custom_itinerary_tabs( $boolean ) {
    return false;
    }
add_filter( 'wp_travel_custom_itinerary_tabs', 'prefix_wp_travel_custom_itinerary_tabs' );

Filter: wp_travel_trip_discounts #

Discount implementation.

Source

File: /core/helpers/cart.php
Used by: /core/helpers/cart.php, /inc/cart/class-cart.php

Parameters
$discount, $cart_items

Example:

function prefix_wp_travel_trip_discounts( $discount, $cart_items ) {
    $discount[‘value’] = 200;
    return $discount;
    }
add_filter( 'wp_travel_trip_discounts', 'prefix_wp_travel_trip_discounts', 12, 2 );

Filter: wp_travel_is_custom_tabs_support_enabled #

Custom tab support enable/disable.

Source

File: /core/helpers/settings.php
Used by: /core/helpers/settings.php, /inc/helpers.php,
                 /inc/admin/views/tabs/tab-contents/settings/tabs-global.php

Example:

function prefix_wp_travel_is_custom_tabs_support_enabled() {
    return false
}
add_filter( 'wp_travel_is_custom_tabs_support_enabled', 'prefix_wp_travel_is_custom_tabs_support_enabled' );

Filter: wp_travel_multiple_currency #

Support for multiple currencies.

Source

File: /core/helpers/trip-extras.php
Used by: /core/helpers/trip-extras.php, /core/helpers/trip-pricing-categories.php

Parameters
$price

Example:

function prefix_wp_travel_multiple_currency( $price ) {
    $price = ( $price * 1.6 );
    return $price;
}
add_filter( 'wp_travel_multiple_currency', 'prefix_wp_travel_multiple_currency' );

Filter: wp_travel_trip_zoomlevel #

Google map zoom level.

Source

File: /core/helpers/trips.php
Used by: /core/helpers/trips.php

Parameters
$zoomlevel, $trip_id

Example:

function prefix_wp_travel_trip_zoomlevel( $zoomlevel, $trip_id ) {
    $zoomlevel = 15;
    return $zoomlevel;
}
add_filter( 'wp_travel_trip_zoomlevel', 'prefix_wp_travel_trip_zoomlevel', 12, 2 );

Filter :wp_travel_trip_data #

Filter to add trip custom data.

Source

File: /core/helpers/trips.php
Used by: /core/helpers/trips.php

Parameters
$trip_data, $trip->ID

Example:

function prefix_wp_travel_trip_data( $trip_data, $trip_id ) {
    $trip_data[‘custom_data’] = ‘Hello World’;
    return $trip_data;
}
add_filter( 'wp_travel_trip_data', 'prefix_wp_travel_trip_data', 12, 2 );

Filter: wp_travel_available_pax #

Filter to add trip custom data.

Source

File: /core/helpers/trips.php
Used by: /core/helpers/trips.php

Parameters
$trip_data, $trip->ID

Example:

function prefix_wp_travel_trip_data( $trip_data, $trip_id ) {
    $trip_data[‘custom_data’] = ‘Hello World’;
    return $trip_data;
}
add_filter( 'wp_travel_trip_data', 'prefix_wp_travel_trip_data', 12, 2 );

Filter: apply_filters( wp_travel_trip_duration, $content, $post_id ) #

WP Travel gets trip duration html.

Source

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

Parameters
$content

Example:

function prefix_wp_travel_trip_duration( $content ) {
    $content = ‘MODIFY TRIP DURATION HTML HERE’;
    return $content;
}
add_filter( 'wp_travel_trip_duration', 'prefix_wp_travel_trip_duration' );

Filter: wp_travel_itinerary_tabs #

WP Travel single itinerary tabs.

Active Since v1.9.3

Source

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

Parameters
$return_tabs

Example:

function prefix_wp_travel_itinerary_tabs( $return_tabs ) {
    // $return_tabs( Array )
    // Code here.
    return $return_tabs;
}
add_filter( 'wp_travel_itinerary_tabs', 'prefix_wp_travel_itinerary_tabs' );

Filter: wp_travel_trip_code #

WP Travel trip code.

Source

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

Parameters
$code, $post_id

Example:

function prefix_wp_travel_trip_code( $code, $post_id ) {
    $code = ‘TRIP ’. $post_id ;
    return $code;
}
add_filter( 'wp_travel_trip_code', 'prefix_wp_travel_trip_code', 12, 2 );

Filter: wp_travel_default_trip_tabs #

WP Travel default trip tabs.

Active Since v1.9.3

Source

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

Parameters
$return_tabs

Example:

function prefix_wp_travel_default_trip_tabs( $return_tabs ) {
    $return_tabs[‘overview’][‘label’] = __( ‘This is overview
    tab’, ‘wp-travel’);
    return $return_tabs;
}
add_filter( 'wp_travel_default_trip_tabs', 'prefix_wp_travel_default_trip_tabs' );

Filter: wp_travel_fixed_departure_defalut #

Fixed departure enable/disable.

Source

File: /inc/helpers.php
Used by: /inc/helpers.php, /inc/template-functions.php,
/inc/admin/views/tabs/tab-contents/itineraries/price.php

Parameters
$fixed_departure

Example:

function prefix_wp_travel_fixed_departure_defalut( $fixed_departure) {
    return ‘no’;
}
add_filter( 'wp_travel_fixed_departure_defalut', 'prefix_wp_travel_fixed_departure_defalut' );

Filter: wp_travel_itinerary_faq_questions #

WP Travel faq questions for itinerary.

Active Since v2.0.7

Source

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

Parameters
$questions, $post_id

Example:

function prefix_wp_travel_itinerary_faq_questions( $questions, $post_id ) {
    // $questions ( Array )
    // Add FAQ question here
    return $questions;
}
add_filter( 'wp_travel_itinerary_faq_questions', 'prefix_wp_travel_itinerary_faq_questions', 12, 2 );

Filter: wp_travel_itinerary_faq_answers #

WP Travel faq answers for itinerary.

Active Since v2.0.7

Source

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

Parameters
$answers, $post_id

Example:

function prefix_wp_travel_itinerary_faq_answers( $answers, $post_id ) {
    // $answers ( Array )
    // Add FAQ answers here
    return $answers;
}
add_filter( 'wp_travel_itinerary_faq_answers', 'prefix_wp_travel_itinerary_faq_answers', 12, 2 );

Filter: wp_travel_hide_per_person #

WP Travel per person in a single trip page show or hide.

Active Since v2.0.5

Source

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

Parameters
Default is false, $trip_id, $price_key

Example:

function prefix_wp_travel_hide_per_person() {
    return true;
}
add_filter( 'wp_travel_hide_per_person', 'prefix_wp_travel_hide_per_person' );

Filter: wp_travel_display_currency_symbol #

Filter for display currency symbol.

Active Since v2.0.1/ 2.0.3

Source

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

Parameters
$currency_symbol, $post_id

Example:

function prefix_wp_travel_display_currency_symbol( $price ) {
    $currency_symbol = __( ‘NPR’, ‘wp-travel’ );
    return $currency_symbol;
}
add_filter( 'wp_travel_display_currency_symbol', 'prefix_wp_travel_display_currency_symbol', 12, 2 );

Filter: wp_travel_related_post_title #

WP Travel related trips title.

Source

File: /templates/content-related-posts.php
Used by: /templates/content-related-posts.php

Parameters
Default is ‘esc_html__( ‘Related Trips’, ‘wp-travel’ )’.

Example:

function prefix_wp_travel_related_post_title( $max_available, $pax_limit ) {
    return ‘esc_html__( 'Here are Related Trips', 'wp-travel' )’;
}
add_filter( 'wp_travel_related_post_title', 'prefix_wp_travel_related_post_title' );

WP Travel related trips column per row.

Source

File: /templates/content-related-posts.php
Used by: /templates/content-related-posts.php

Parameters
Default is 3.

Example:

function prefix_wp_travel_related_itineraries_col_per_row() {
    return 4;
}
add_filter( 'wp_travel_related_itineraries_col_per_row', 'prefix_wp_travel_related_itineraries_col_per_row' );

Filter: wp_travel_placeholder_image_url #

This filter allows you to display your own logo image instead of WP Travel placeholder image in single itinerary page.

Active Since v4.4.2

Example :

function wp_travel_customized_placeholder_url( $url ) {
    return 'http://wp-travel.test/wp-content/uploads/2021/07/company-name.png';
}
add_filter( 'wp_travel_placeholder_image_url', 'wp_travel_customized_placeholder_url' );

Filter: wptravel_enable_itinerary_toogle #

To Add a Trip Itinerary in an Accordion Format?

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