Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wpml get translated post id

// 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 );
 
PREVIOUS NEXT
Tagged: #wpml #translated #post #id
ADD COMMENT
Topic
Name
8+7 =