Filters Associated With Settings

Filter: wp_travel_settings_react_enabled #

React settings for trip enable/disable.

Source

File: /app/inc/admin/assets.php
Used by: /app/inc/admin/assets.php, /app/inc/admin/localize.php, /inc/helpers.php

Example:

function prefix_wp_travel_settings_react_enabled( $size ) {
    return false;
    }
add_filter( 'wp_travel_settings_react_enabled', 'prefix_wp_travel_settings_react_enabled' );

Filter: wp_travel_settings_values #

Main settings value filter.

Source

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

Parameters
$settings

Example:

function prefix_wp_travel_settings_values( $settings ) {
    $settings[‘custom_data’] = array( ‘data1’, ‘data2’, );
    return $settings;
}
add_filter( 'wp_travel_settings_values', 'prefix_wp_travel_settings_values' );

Filter: wp_travel_settings_options #

Main settings additional values like dropdown options etc.

Source

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

Parameters
$settings_options, $settings

Example:

function prefix_wp_travel_settings_options( $settings_options, $settings ) {
    $settings_options[‘custom_data’] = array( ‘data1’, ‘data2’,
    );
    return $settings_options;
}
add_filter( 'wp_travel_settings_options', 'prefix_wp_travel_settings_options', 12, 2 );

Filter: wp_travel_block_before_save_settings #

Filter before main save settings.

Source

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

Parameters
$settings, $settings_data

Example:

function prefix_wp_travel_block_before_save_settings( $settings, $settings_data ) {
    $settings_data[‘custom_data’] = array( ‘data1’, ‘data2’, );
    $settings[ ‘custom_data’ ] = $settings_data[‘custom_data’];
    return $settings;
}
add_filter( 'wp_travel_block_before_save_settings', 'prefix_wp_travel_block_before_save_settings', 12, 2 );

Filter: wp_travel_currencies #

WP Travel currencies list.

Source

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

Parameters
$currency

Example:

function prefix_wp_travel_currencies( $currency ) {
    $currency[‘CURRENCY SHORT FORM’] = ‘CURRENCY NAME’;
    return $countries;
}
add_filter( 'wp_travel_currencies', 'prefix_wp_travel_currencies' );

Filter: wp_travel_currency_symbol #

WP Travel currency symbol filter.

Source

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

Parameters
$currency_symbols[ $currency_code ], $currency_code, $currency_symbols

Example:

function prefix_wp_travel_currency_symbol( $currency_symbols[ $currency_code ], $currency_code, $currency_symbols ) {
    $currency_symbols[ $currency_code ] = __( 'NPR', 'wp-travel'
    );
    return $currency_symbols;
}
add_filter( 'wp_travel_currency_symbol', 'prefix_wp_travel_currency_symbol', 12, 3 );

Filter: wp_travel_settings_fields #

WP Travel settings fields.

Active Since v1.9.0

Source

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

Parameters
$settings_fields

Example:

function prefix_wp_travel_settings_fields( $settings_fields ) {
    $settings_fields[‘custom_key’] = ‘value’;
    return $settings_fields;
}
add_filter( 'wp_travel_settings_fields', 'prefix_wp_travel_settings_fields' );

Filter: wp_travel_tabs #

WP Travel admin tabs.

Source

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

Parameters
$tabs

Example:

function prefix_wp_travel_tabs( $tabs ) {
    $tabs[‘custom_tab’] = array(
    'tab_label' => __( 'Custom Tab',
    'wp-travel' ),
    'content_title' => __( ‘Custom Tabs',
    'wp-travel' ),
    'priority' => 130,
    'callback' =>
    'wp_travel_trip_callback_custom_tab',
    // 'icon' => 'fa-images',
    ),
    return $tabs;
}
add_filter( 'wp_travel_tabs', 'prefix_wp_travel_tabs' );

Filter: wp_travel_settings_tabs #

Filter for modify/add settings tab.

Source

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

Parameters
$settings_fields

Example:

function prefix_wp_travel_settings_tabs( $settings_fields ) {
    $settings_fields[‘custom_tab’] = array(
    'tab_label' => __( 'Custom', 'wp-travel' ),
    'content_title' => __( 'Custom Options',
    'wp-travel' ),
    'priority' => 105,
    'callback' =>
    'wp_travel_settings_callback_custom',
    'icon' => 'fa-gear',
    );
    return $settings_fields;
}
add_filter( 'wp_travel_settings_tabs', 'prefix_wp_travel_settings_tabs' );

Filter: wp_travel_before_save_settings #

WP Travel settings before updating to database.

Active Since v1.0.5

Source

File: /inc/admin/class-admin-settings.php
Used by: /inc/admin/class-admin-settings.php, /inc/admin/class-network-settings.php

Parameters
$settings

Example: 

function prefix_wp_travel_before_save_settings( $settings ) {
    $settings[‘wp_travel_bank_deposits’] = ‘ADD DATA HERE’;
    return $settings;
}
add_filter( 'wp_travel_before_save_settings', 'prefix_wp_travel_before_save_settings' );

Filter: wp_travel_admin_tabs #

WP Travel gets admin tabs.

Source

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

Parameters
$tabs

Example:

function prefix_wp_travel_admin_tabs( $tabs ) {
    $tour_extras['tour_extras_general'] = array(
    'tab_label' => __( 'General', 'wp-travel' ),
    'content_title' => __( 'General Settings',
    'wp-travel' ),
    'priority' => 10,
    'callback' =>
    'wp_travel_tour_extras_general_tab_callback',
    'icon' => 'fa-sticky-note',
    );
    $tabs[ ‘tour-extras’ ] = $tour_extras;
    return $tabs;
}
add_filter( 'wp_travel_admin_tabs', 'prefix_wp_travel_admin_tabs' );

Filter: wp_travel_network_settings_tabs #

WP Travel network settings tab filter.

Source

File: /inc/admin/class-network-settings.php
Used by: /inc/admin/class-network-settings.php

Parameters
$settings_fields

Example:

function prefix_wp_travel_network_settings_tabs( $settings_fields ) {
    // Code here for adding tab on network settings.
    return $settings_fields;
}
add_filter( 'wp_travel_network_settings_tabs', 'prefix_wp_travel_network_settings_tabs' );