WPML Otrzymuj przetłumaczony identyfikator postu

// WPML get Post on translated Language
// The only parameter you have to use is -> $postIdToTranslate
// 'POST_TYPE_NAME' can be: post, page, or your custom post type name
// ICL_LANGUAGE_CODE can be 'en','es', etc.
$translatedPostId = icl_object_id($postIdToTranslate, 'POST_TYPE_NAME', false, ICL_LANGUAGE_CODE);
$myPost = get_post( $translatedPostId );
gtamborero