📜  wpml 获取翻译后的 id - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:38.035000             🧑  作者: Mango

代码示例1
// WPML get Post on translated Language
// The only parameter you have to use is -> $postIdToTranslate
$translatedPostId = icl_object_id($postIdToTranslate, 'page', false, ICL_LANGUAGE_CODE);
$myPost = get_post( $translatedPostId );