Table of Contents

Filter : wp_travel_strings #

This filter changes the string.

Source

File : /core/helpers/strings.php

Used by
/core/helpers/strings.php

Example :

function wp_travel_change_string($localized_strings){
    $localized_strings ['bookings']['start_date'] = 'Departure Date';
    $localized_strings ['bookings']['arrival_date'] = 'Departure Date';
    return $localized_strings;

}
add_filter('wp_travel_strings','wp_travel_change_string');

Filter :wp_travel_thankyou_page_url #

Thank You Page after checkout URL.

Source

File: /inc/booking-functions.php
Used by: /inc/booking-functions.php, /inc/helpers.php,
                 /inc/gateway/standard-paypal/class-wp-travel-gateway-paypal-request.php

Parameters
$thankyou_page_url, $booking_id

Example:

function prefix_wp_travel_thankyou_page_url( $thankyou_page_url, $booking_id ) {
    $thankyou_page_url = ‘URL’;
    return $thankyou_page_url;
}
add_filter( 'wp_travel_thankyou_page_url', 'prefix_wp_travel_thankyou_page_url', 12, 2 );

Filter :wp_travel_enqueue_single_assets #

Filter for enqueue assets if true.

Source

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

Parameters
$is_wp_travel_single_pages, $trip_id

Example:

function prefix_wp_travel_enqueue_single_assets( $is_wp_travel_single_pages, $trip_id ) {
    $is_wp_travel_single_pages = is_singular(‘YOUR CUSTOM POST TYPES’);
    return $is_wp_travel_single_pages;
}
add_filter( 'wp_travel_enqueue_single_assets', 'prefix_wp_travel_enqueue_single_assets', 12, 2 );

Filter : gettext #

This filter helps to replace the text ‘Pricing Name’.

Example :

add_filter( 'gettext', 'wp_travel_change_field_names', 20, 3 );

function wp_travel_change_field_names( $translated_text, $text, $domain ) {

    if ( is_singular() ) {

      switch ( $translated_text ) {

      case 'Pricing Name' :

      $translated_text = __( 'your text here', 'wp-travel' );
      break;
      }

    }

return $translated_text;
}

Filter :wp_travel_frontend_data #

WP Travel localized variable for frontend.

Source

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

Parameters
$wp_travel, $settings

Example:

function prefix_wp_travel_frontend_data( $wp_travel, $settings ) {
    $wp_travel[‘custom_key’] = ‘value’;
    return $wp_travel;
}
add_filter( 'wp_travel_frontend_data', 'prefix_wp_travel_frontend_data', 12, 2 );

Filter :apply_filters( wp_travel_chart_data, $wp_travel_chart_data ) #

WP Travel localized variable of chart data for admin.

Source

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

Parameters
$wp_travel_chart_data

Example:

function prefix_wp_travel_chart_data( $wp_travel_chart_data ) {
    $wp_travel_chart_data[‘custom_key’] = ‘value’;
    return $wp_travel_chart_data;
}
add_filter( 'wp_travel_chart_data', 'prefix_wp_travel_chart_data' );

WP Travel localized variable of gallery data for admin.

Source

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

Parameters
$wp_travel_gallery_data

Example:

function prefix_wp_travel_localize_gallery_data( $wp_travel_gallery_data ) {
    $wp_travel_gallery_data[‘custom_key’] = ‘value’;
    return $wp_travel_gallery_data;
}
add_filter( 'wp_travel_localize_gallery_data', 'prefix_wp_travel_localize_gallery_data' );

Filter :wp_travel_registered_scripts #

WP Travel registered scripts for frontend.

Source

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

Parameters
$assets

Example:

function prefix_wp_travel_registered_scripts( $assets ) {
    $assets[‘scripts’][‘custom_scripts’] = ‘Enqueue part here’;
    return $assets;
}
add_filter( 'wp_travel_registered_scripts', 'prefix_wp_travel_registered_scripts' );

Filter :wptravel_wpml_object_id #

To resolve the pages mismatch issue when using WPML.

Active Since v3.1.8

Source

File: wp-travel.php
Used by: wp-travel.php, /templates/content-cart.php

Parameters
(int) $value[ $skey ], $skey, true

Example:

function get_wp_travel_page_id_by_locale( $page_id, $option ) {
if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
$_page_id = get_option( "wp_travel_{$option}_" . ICL_LANGUAGE_CODE, $_page_id );
}
return $_page_id;
}
add_filter( 'wptravel_wpml_object_id', 'get_wp_travel_page_id_by_locale', 11, 2 );

Filter :plugin_locale #

Load localisation file.

Source

File: wp-travel.php
Used by: wp-travel.php

Parameters
$locale

Example:

function prefix_wp_travel_locale( $locale ) {
    $locale = get_user_locale();
    return $locale;
}
add_filter( 'plugin_locale', 'prefix_wp_travel_locale' );

Filter :wp-travel-pro-bundle-items #

WP Travel bundle registered styles/scripts for frontend.

Source

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

Parameters
$assets

Example:

function prefix_wp-travel-pro-bundle-items( $assets ) {
    $assets[‘styles’][‘custom_styles’] = ‘Enqueue part here’;
    return $assets;
}
add_filter( 'wp-travel-pro-bundle-items', 'prefix_wp-travel-pro-bundle-items' );

Filter :wp-travel-script-handles #

WP Travel script handles for loading bundled scripts.

Source

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

Parameters
$data

Example:

function prefix_wp-travel-script-handles( $data ) {
    // $data ( Array ).
    // Code here
    return $data;
}
add_filter( 'wp-travel-script-handles', 'prefix_wp-travel-script-handles' );

Filter :wp_travel_the_content #

WP Travel gets post content.

Source

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

Example:

function prefix_wp_travel_the_content() {
    $content = the_content();
    return $content’;
}
add_filter( 'wp_travel_the_content', 'prefix_wp_travel_the_content' );

Filter :wp_travel_shortcode_atts #

WP Travel trip filter shortcode attributes.

Source

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

Parameters
$defaults

Example:

function prefix_wp_travel_shortcode_atts( $default ) {
    $default[‘fact’] = 2;
    return $default;
}
add_filter( 'wp_travel_shortcode_atts', 'prefix_wp_travel_shortcode_atts' );

Filter :wp_travel_save_customer_billing_details_required_fields #

Filter for customer billing details required field.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$fields

Example:

function prefix_wp_travel_save_customer_billing_details_required_fields( $fields ) {
    $fields[‘customer_zip_code’] = ‘ __( 'Your ZIP Code',
    'wp-travel' )’;
    return $fields;
}
add_filter( 'wp_travel_save_customer_billing_details_required_fields', 'prefix_wp_travel_save_customer_billing_details_required_fields' );

Filter :wp_travel_save_account_details_required_fields #

Filter for customer account details required field.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$fields

Example:

function prefix_wp_travel_save_account_details_required_fields( $fields ) {
    $fields[‘acccount_first_name’] = ‘ __( 'First Name',
    'wp-travel' )’;
    return $fields;
}
add_filter( 'wp_travel_save_account_details_required_fields', 'prefix_wp_travel_save_account_details_required_fields' );

Filter :wp_travel_get_query_vars #

Filter for getting query variables.

Source

File: /inc/class-wp-travel-query.php
Used by: /inc/class-wp-travel-form-query.php

Parameters
$query_vars

Example:

function prefix_wp_travel_get_query_vars( $query_vars ) {
    // $query_vars (array).
    // Code here
    return $query_vars;
}
add_filter( 'wp_travel_get_query_vars', 'prefix_wp_travel_get_query_vars' );

Filter :wp_travel_user_dashboard_menus #

Filter for WP Travel dashboard menus.

Source

File: /inc/class-wp-travel-user-account.php
Used by: /inc/class-wp-travel-user-account.php

Parameters
$dashboard_menus

Example:

function prefix_wp_travel_user_dashboard_menus( $dashboard_menus ){
    $dashboard_menus[‘test’] => array(
    'menu_title' => __( 'Test', 'wp-travel' ),
    'menu_icon' => '',
    'menu_content_cb' =>
    'dashboard_menu_test_tab' ),
    'priority' => 60,
    ),
    return $dashboard_menus;
}
add_filter( 'wp_travel_user_dashboard_menus', 'prefix_wp_travel_user_dashboard_menus' );

Filter :wp_travel_frontend_tab_show_in_menu #

WP Travel show tab in frontend menu.

Active Since v1.9.3

Source

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

Parameters
Default is yes.

Example:

function prefix_wp_travel_frontend_tab_show_in_menu() {
    return ‘no’;
}
add_filter( 'wp_travel_frontend_tab_show_in_menu', 'prefix_wp_travel_frontend_tab_show_in_menu' );

Filter :wp_travel_trip_availability #

WP Travel trip available or not filter.

Active Since v3.1.3

Source

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

Parameters
$availability, $trip_id, $price_key, $start_date

Example:

function prefix_wp_travel_trip_availability( $availability, $trip_id, $price_key, $start_date ) {
    return true;
}
add_filter( 'wp_travel_trip_availability', 'prefix_wp_travel_trip_availability', 12, 4 );

Filter :wp_travel_submenus #

WP Travel submenus list filter.

Source

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

Parameters
$all_submenus

Example:

function prefix_wp_travel_submenus( $all_submenus ) {
    $all_submenus[‘bookings’][‘settings2’] = array(
    'priority' => '130',
    'page_title' => __( 'WP Travel Settings2',
    'wp-travel' ),
    'menu_title' => __( 'Settings2', 'wp-travel' ),
    'menu_slug' => 'settings2',
    'callback' => 'setting_page_callback',
    );
    return $all_submenus;
}
add_filter( 'wp_travel_submenus', 'prefix_wp_travel_submenus' );

Filter :.wp_travel_error_codes #

Error codes for WP Travel.

Active Since v4.0.0

Source

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

Parameters
$error_codes, $args

Example:

function prefix_wp_travel_error_code( $error_codes, $args ) {
    $error_codes[‘YOUR_CUSTOM_CODE’] = array ('message' => __( 'Message here.', 'wp-travel' ),
);
    return $error_codes;
}
add_filter( 'wp_travel_error_code', 'prefix_wp_travel_error_code', 12, 2 );

Filter :wp_travel_theme_wrapper_class #

WP Travel theme wrapper class filter.

Source

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

Parameters
$wrapper_class, $template

Example:

function prefix_wp_travel_theme_wrapper_class( $wrapper_class, $template ) {
    $wrapper_class = ‘custom-class’;
    return $wrapper_class;
}
add_filter( 'wp_travel_theme_wrapper_class', 'prefix_wp_travel_theme_wrapper_class', 12, 2 );

Filter :wp_travel_trip_tabs_output_raw #

WP Travel raw output on tab content ( without using ‘the_content’ filter ).

Source

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

Parameters
Default is false, $tab_key

Example:

function prefix_wp_travel_trip_tabs_output_raw( $raw, $tab_key ) {
    if ( 'gallery' === $tab_key ) { // Hide extra tab content on
    gallery tab.
    $raw = true;
    }
    return $raw;
    }
}
add_filter( 'wp_travel_trip_tabs_output_raw', 'prefix_wp_travel_trip_tabs_output_raw', 10, 2 );

Filter :wp_travel_premium_addons_list #

WP Travel Premium addons list.

Source

File: /core/helpers/license.php
Used by: /core/helpers/license.php, /inc/license/wp-travel-license.php

Parameters
$premium_addons

Example:

function prefix_wp_travel_premium_addons_list( $premium_adddons ) {
    $premium_addons[‘wp_travel_downloads’] = ‘WP Travel Downloads’;
    return $premium_addons;
}
add_filter( 'wp_travel_premium_addons_list', 'prefix_wp_travel_premium_addons_list' );

Filter :wp_travel_review_count #

Total count of reviews.

Source

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

Parameters
$count, $post

Example:

function prefix_wp_travel_review_count( $count, $post ) {
    if ( ‘100’ === $post->ID ) {
    $count = 5;
    }
    return $count;
}
add_filter( 'wp_travel_review_count', 'prefix_wp_travel_review_count', 10, 2 );

Filter :wp_travel_success_codes #

WP Travel Success codes.

Source

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

Parameters
$codes

Example:

function prefix_wp_travel_success_codes( $codes ) {
    $codes[‘YOUR_CUSTOM_CODE’] =
    return $premium_addons;
}
add_filter( 'wp_travel_success_codes', 'prefix_wp_travel_success_codes' );

Filter :wp_travel_booked_message #

Message after booking has been made.

Source

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

Parameters
Default is ‘__( “We’ve received your booking details. We’ll contact you soon.”, ‘wp-travel’
)’.

Example:

function prefix_wp_travel_booked_message() {
    return ‘__( ‘Booking has been received. We’ll contact you
    shortly.’, ‘wp-travel’ )’;
}
add_filter( 'wp_travel_booked_message', 'prefix_wp_travel_booked_message' );

Filter: wp_travel_default_group_size_text #

Group size default text.

Source

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

Parameters
Default is ‘esc_html__( ‘No Size Limit’, ‘wp-travel’ ) )’.

Example:

function prefix_wp_travel_default_group_size_text() {
    return ‘__( ‘Unlimited Size’, ‘wp-travel’ )’;
}
add_filter( 'wp_travel_default_group_size_text', 'prefix_wp_travel_default_group_size_text' );

Filter: wp_travel_pagination_range #

Archive page pagination range.

Source

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

Parameters
Default is 2.

Example:

function prefix_wp_travel_pagination_range() {
    return ‘4’;
}
add_filter( 'wp_travel_pagination_range', 'prefix_wp_travel_pagination_range' );

Filter: wp_travel_get_endpoint_url #

Get endpoint url filter.

Source

File: /inc/wp-travel-user-functions.php
Used by: /inc/wp-travel-user-functions.php

Parameters
$url, $endpoint, $value, $permalink

Example

function prefix_wp_travel_get_endpoint_url( $url, $endpoint, $value, $permalink ) {
    // Code here for url.
    return $url;
}
add_filter( 'wp_travel_get_endpoint_url', 'prefix_wp_travel_get_endpoint_url', 12, 4 );

Filter: wp_travel_create_page_id #

Filter for checking if a valid page was found.

Source

File: /inc/admin/admin-helper.php
Used by: /inc/admin/admin-helper.php

Parameters
$valid_page_found, $slug, $page_content

Example:

function prefix_wp_travel_create_page_id() {
    return true;
}
add_filter( 'wp_travel_create_page_id', 'prefix_wp_travel_create_page_id' );

Filter: wp_travel_show_upsell_message #

Show upsell message or not filter.

Source

File: /inc/admin/admin-helper.php
Used by: /inc/admin/admin-helper.php

Parameters
Default is true, $types

Example:

function prefix_wp_travel_show_upsell_message() {
    return false;
}
add_filter( 'wp_travel_show_upsell_message', 'prefix_wp_travel_show_upsell_message' );

Filter: wp_travel_save_trip_metas #

Saving trip metas of WP Travel.

Active Since v1.8.4

Source

File: /inc/admin/class-admin-metaboxes.php
Used by: /inc/admin/class-admin-metaboxes.php

Parameters
$trip_meta, $post_id

Example:

function prefix_wp_travel_save_trip_metas( $trip_meta, $post_id ) {
    $trip_meta[‘wp_travel_my_custom_data’] = ‘VALUE’;
    return $trip_meta;
}
add_filter( 'wp_travel_save_trip_metas', 'prefix_wp_travel_save_trip_metas', 12, 2 );

Filter: wp_travel_multiple_fixed_departures #

WP Travel multiple fixed departure enable or not.

Source

File: /inc/admin/extras/views/tabs/tab-contents/itineraries/price.php
Used by: /inc/admin/extras/views/tabs/tab-contents/itineraries/price.php

Parameters
$multiple_fixed_departures ( boolean )

Example:

function prefix_wp_travel_multiple_fixed_departures() {
    return ‘no’;
}
add_filter( 'wp_travel_multiple_fixed_departures', 'prefix_wp_travel_multiple_fixed_departures' );

Filter :wp_travel_coupons_tabs #

Add coupon tabs.

Source

File: /inc/coupon/inc/admin/class-admin-metaboxes.php
Used by: /inc/coupon/inc/admin/class-admin-metaboxes.php

Parameters
$tabs

Example:

function prefix_wp_travel_coupons_tabs( $tabs ) {
    $coupons['coupons_restrictions'] = array(
    'tab_label' => __( 'Restrictions',
    'wp-travel' ),
    'content_title' => __( 'Coupon Restrictions',
    'wp-travel' ),
    'priority' => 110,
    'callback' =>
    'wp_travel_coupons_restrictions_tab_callback',
    'icon' => 'fa-lock',
    );
    $tabs[ ‘wp-travel-coupons’ ] = $coupons;
    return $tabs;
}
add_filter( 'wp_travel_coupons_tabs', 'prefix_wp_travel_coupons_tabs' );

Filter: wp_travel_register_field_types #

Filter for registering field types for WP Travel.

Source

File: /inc/framework/form/class.field.php
Used by: /inc/framework/form/class.field.php

Parameters
$field_types

Example:

function prefix_wp_travel_register_field_types( $field_types ) {
    $field_types['file'] = array(
    'label' => __( 'File', 'wp-travel' ),
    'class' => 'WP_Travel_FW_Field_File',
    );
    return $field_types;
}
add_filter( 'wp_travel_register_field_types', 'prefix_wp_travel_register_field_types' );

Filter :wp_travel_paypal_args #

Filter for getting paypal arguments.

Source

File: /inc/gateways/standard-paypal/class-wp-travel-gateway-paypal-request.php
Used by: /inc/gateways/standard-paypal/class-wp-travel-gateway-paypal-request.php

Parameters
$args

Example:

function prefix_wp_travel_paypal_args( $args ) {
    $args[ ‘CUSTOM_INPUT’ ] = ‘VALUE’;
    return $args;
}
add_filter( 'wp_travel_paypal_args', 'prefix_wp_travel_paypal_args' );

Filter :wp_travel_stat_default_query_limit #

Filter for query limits on getting booking data.

Active Since v1.0.5

Source

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

Parameters
Default is 10.

Example:

function prefix_wp_travel_stat_default_query_limit() {
    return 8;
}
add_filter( 'wp_travel_stat_default_query_limit', 'prefix_wp_travel_stat_default_query_limit' );

Filter :wp_travel_booking_status_list #

WP Travel booking status list.

Active Since v1.0.5

Source

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

Parameters
$status

Example:

function prefix_wp_travel_booking_status_list( $status ) {
    $status[‘processing’] = array(
    'color' => '#FF9800,
    'text' => __( 'Under Processing',
    'wp-travel' ),
    ),
    return $status;
}
add_filter( 'wp_travel_booking_status_list', 'prefix_wp_travel_booking_status_list' );

Filter: wp_travel_data_max_pax #

WP Travel data maximum pax.

Source

File: /templates/content-cart.php
Used by: /templates/content-cart.php

Parameters
$max_available, $pax_limit

Example:

function prefix_wp_travel_data_max_pax( $max_available, $pax_limit ) {
    $max_available = 10;
    return $max_available;
}
add_filter( 'wp_travel_data_max_pax', 'prefix_wp_travel_data_max_pax', 12, 2 );

Filter: wp_travel_product_review_comment_form_args #

WP Travel review form arguments.

Source

File: /templates/single-wp-travel-reviews.php
Used by: /templates/single-wp-travel-reviews.php

Parameters
$comment_form

Example:

function prefix_wp_travel_product_review_comment_form_args( $comment_form ) {
    $comment_form[‘custom_field’] = ‘values’;
    return $comment_form;
}
add_filter( 'wp_travel_product_review_comment_form_args', 'prefix_wp_travel_product_review_comment_form_args' );

Filter: wptravel_after_thankyou_page_content #

Add custom content (HTML, Script) in thank you page

Source

File : wp-travel-pro/inc/modules/utilities-core/inc/class-wp-travel-utilities-shortcodes.php

Parameters : $booking_id, $payment_id, $trip_price

Example:

if ( isset( $_GET['order_id'] ) && ! empty( $_GET['order_id'] ) ) {
        $booking_id = $_GET['order_id'];
        $payment_id   = get_post_meta( $booking_id, 'wp_travel_payment_id', true );
	$trip_price  = get_post_meta( $payment_id, 'wp_travel_trip_price', true );
        error_log( print_r( 'booking id ' . $booking_id, true ) );
        error_log( print_r( 'payment id ' . $payment_id, true ) );
        // Here you can use $trip_price as your amount param and $booking_id as order id
        ?>
        <script>
            var booking_id = '<?php echo $booking_id; ?>';
            var trip_price = '<?php echo $trip_price; ?>';
            var ttConversionOptions = ttConversionOptions || [];
        </script>
        <?php
    }
}
add_action( 'wptravel_after_thankyou_page_content', 'wptravel_customized_thankyou_page_additional_fields' );