yith_wcwl_object_id

Retrieve translated page id, if wpml is installed.

Description

(int) yith_wcwl_object_id( $id ); 

Returns (int)

Translation id

Parameters (1)

0. $id
Int Original page id

Usage

  1. if ( !function_exists( 'yith_wcwl_object_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/includes/functions.yith-wcwl.php'; 
  3.  
  4. // int Original page id 
  5. $id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = yith_wcwl_object_id($id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.yith-wcwl.php  
  1. function yith_wcwl_object_id( $id ) { 
  2. if( function_exists( 'wpml_object_id_filter' ) ) { 
  3. return wpml_object_id_filter( $id, 'page', true ); 
  4. elseif( function_exists( 'icl_object_id' ) ) { 
  5. return icl_object_id( $id, 'page', true ); 
  6. else{ 
  7. return $id;