Filters Associated With Inventory

Filter: wp_travel_inventory_args #

Trip Inventory arguments in array.

Active Since v4.0.0

Source

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

Parameters
$inventory_args

Example:

function prefix_wp_travel_inventory_args( $inventory_args ) {
    $inventory_args[‘custom_data’] = ‘CUSTOM DATA’;
    return $inventory_args;
}
add_filter( 'wp_travel_inventory_args', 'prefix_wp_travel_inventory_args' );

Filter: wp_travel_inventory_data #

WP Travel inventory datas in array.

Source

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

Parameters
$inventory_data, $trip_id, $price_key, $start_date

Example:

function prefix_wp_travel_inventory_data( $inventory_data, $trip_id, $price_key, $start_date ) {
    $inventory_data[‘max_pax’] = 5;
    return $inventory_data;
}
add_filter( 'wp_travel_inventory_data', 'prefix_wp_travel_inventory_data' );

Filter: inventory_enabled #

Inventory enabled or not.

Active Since v3.0.0

Source

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

Parameters
Default is false, $trip_id.

Example:

function prefix_inventory_enabled() {
    return true;
}
add_filter( 'inventory_enabled', 'prefix_inventory_enabled' );

Filter: wp_travel_inventory_sold_out_button #

Inventory sold out message.

Source

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

Parameters
Default is ’ ‘, $trip_id.

Example:

function prefix_wp_travel_inventory_sold_out_button() {
    return ‘__( ‘Sold Out!’, ‘wp-travel’ )’;
}
add_filter( 'wp_travel_inventory_sold_out_button', 'prefix_wp_travel_inventory_sold_out_button' );

Filter: wp_travel_inventory_enable_status_column #

Inventory enables status.

Source

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

Parameters
Default is false, $trip_id.

Example:

function prefix_wp_travel_inventory_enable_status_column() {
    return true;
}
add_filter( 'wp_travel_inventory_enable_status_column', 'prefix_wp_travel_inventory_enable_status_column' );

Filter: wp_travel_inventory_pax_limit #

WP Travel inventory pax limit size.

Source

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

Parameters
Default is ‘ ‘, $trip_id, $price_key

Example:

function prefix_wp_travel_inventory_pax_limit() {
    return 5;
}
add_filter( 'wp_travel_inventory_pax_limit', 'prefix_wp_travel_inventory_pax_limit' );