public static function getID($content_id, $content_type = 'post_page') { $language_code = wpml_get_default_language(); $lang = wpml_get_content_translation($content_type, $content_id, $language_code); if (is_array($lang)) { $id = $lang[$language_code]; } else { $id = $content_id; } return $id; }
public static function getID($content_id, $content_type = 'post_page') { // WPML works with the taxonomy id, DW works with term_id if ($content_type == 'tax_category') { $content_id = self::getTaxID($content_id); } $language_code = wpml_get_default_language(); $lang = wpml_get_content_translation($content_type, $content_id, $language_code); if (is_array($lang)) { $id = $lang[$language_code]; } else { $id = $content_id; } if ($content_type == 'tax_category') { $id = self::getTermID($id); } return $id; }