Search Documentation

WP Travel Developer Documentation

  1. Home
  2. Docs
  3. WP Travel Developer Documentation
  4. Filters
  5. Filter :wptravel_wpml_object_id

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 );
Was this article helpful to you? Yes No

How can we help?