Filters Associated With Tour Extras

Filter: wp_travel_trip_extras_custom_prices #

Filter to add custom price for tour extras.

Source

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

Parameters
$price, $e_id, $trip[‘trip_id’]

Example:

function prefix_wp_travel_trip_extras_custom_prices( $price, $e_id, $trip_id ) {
    $price = 200;
    return $price;
}
add_filter( 'wp_travel_trip_extras_custom_prices', 'prefix_wp_travel_trip_extras_custom_prices', 12, 3 );

Filter: wp_travel_trip_extras_custom_sale_prices #

Filter for custom sale price for trip extras enable/disable.

Source

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

Parameters
$sale_price, $e_id, $trip[‘trip_id’]

Example:

function prefix_wp_travel_trip_extras_custom_sale_prices() {
    return true;
}
add_filter( 'wp_travel_trip_extras_custom_sale_prices', 'prefix_wp_travel_trip_extras_custom_sale_prices' );

Filter: wp_travel_tour_extras_post_type_args #

WP Travel tour extras post type arguments.

Source

File: /inc/class-post-types.php
Used by: /inc/class-post-types.php

Parameters
$args

Example:

function prefix_wp_travel_tour_extras_post_type_args( $args ) {
    $args[‘key’] = ‘value’;
    return $args;
}
add_filter( 'wp_travel_tour_extras_post_type_args', 'prefix_wp_travel_tour_extras_post_type_args' );

Filter: tour_extra_custom_trip_id #

Filter for custom trip if for tour extra.

Source

File: /inc/class-wp-travel-extras-frontend.php
Used by: /inc/class-wp-travel-extras-frontend.php

Parameter
$trip_id

Example:

function prefix_tour_extra_custom_trip_id( $trip_id ) {
    $trip_id = 20;
    return $trip_id;
}
add_filter( 'tour_extra_custom_trip_id', 'prefix_tour_extra_custom_trip_id' );

Filter: wp_travel_trip_extras_heading #

Filter for tour extra heading.

Source

File: /inc/class-wp-travel-extras-frontend.php
Used by: /inc/class-wp-travel-extras-frontend.php

Parameters
Default is ‘Trip Extras’.

Example:

function prefix_wp_travel_trip_extras_heading() {
    return ‘ __( 'Extras for trip:', 'wp-travel' ) )’;
}
add_filter( 'wp_travel_trip_extras_heading', 'prefix_wp_travel_trip_extras_heading' );

Filter: wp_travel_tour_extras_array #

WP Travel gets tour extras array list.

Source

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

Parameters
$itineraries_array, $args

Example:

function prefix_wp_travel_tour_extras_array( $itineraries_array, $args ) {
    $itineraries_array[‘ID’] = ‘SLUG’;
    return $itineraries_array;
}
add_filter( 'wp_travel_tour_extras_array', 'prefix_wp_travel_tour_extras_array', 12, 2 );

Filter: wp_travel_extras_is_pro_enabled #

WP Travel Pro is enabled or not filter.

Source

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

Parameters
Default is false.

Example:

function prefix_wp_travel_extras_is_pro_enabled() {
    return true;
}
add_filter( 'wp_travel_extras_is_pro_enabled', 'prefix_wp_travel_extras_is_pro_enabled' );

Filter: wp_travel_tour_extras_tabs #

WP Travel tour extras tabs.

Source

File: /inc/admin/extras/class-tour-extras-admin-metabox.php
Used by: /inc/admin/extras/class-tour-extras-admin-metabox.php

Parameters
$tabs

Example:

function prefix_wp_travel_tour_extras_tabs( $tabs ) {
    $tour_extras['tour_extras_gallery'] = array(
    'tab_label' => __( 'Gallery', 'wp-travel' ),
    'content_title' => __( 'Gallery', 'wp-travel' ),
    'priority' => 20,
    'callback' =>
    'wp_travel_tour_extras_gallery_tab_callback',
    'icon' => 'fa-images',
    );
    $tabs[ ‘tour-extras’ ] = $tour_extras;
    return $tabs;
}
add_filter( 'wp_travel_tour_extras_tabs', 'prefix_wp_travel_tour_extras_tabs' );

Filter: wp_travel_tour_extra_paypal_args #

Filter for adding tour extra information to paypal.

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, $item, $cart_id, $agrs_index

Example:

function prefix_wp_travel_tour_extra_paypal_args( $args, $item, $cart_id, $agrs_index ) {
    $args[ ‘trip_extra_item_name’. $args_index ] = ‘Extras 1’;
    return $args;
}
add_filter( 'wp_travel_tour_extra_paypal_args', 'prefix_wp_travel_tour_extra_paypal_args', 12, 4 );