WPML translation of post content field is not available in WP All Export
Issue: WPML translation of post content field is not available in WP All Export Reason: WPML saves translation as new post. Solution: Get the element_id of translation using wpml_get_element_translations, then use get_post. PHP function for WP All Export //Usage: [getTranslations({ID},"post_title","th")] function getTranslations($post_id,$field,$selected_lang="th"){ $type = apply_filters( 'wpml_element_type', get_post_type( $post_id ) ); $trid = apply_filters( 'wpml_element_trid', false, $post_id, $type ); $translations = apply_filters( 'wpml_get_element_translations', array(), $trid, $type ); foreach ( $translations as $lang => $translation ) { $translation_array = (array)$translation; if($selected_lang == $translation_array["language_code"]){ $post = get_post($translation->element_id); $post_array = (array)$post; if(isset($post_array[$field])){ return $post_array[$field]; } }