I am trying to: get all translations of variations
Link to a page where the issue can be seen: hidden link
I expected to see: variation IDs of ALL translations
Instead, I got: 2 translations, english language missing. However, the English language is only showing the variation IDs of the english language. However, the German, Dutch and English languages are all connected. Weird eh?
My code:
global $sitepress;
$trid = $sitepress->get_element_trid($variation['variation_id']);
$translations = $sitepress->get_element_translations($trid);
foreach ($translations as $translation):
echo '<pre>';
print_r($translation->element_id);
echo '</pre>';;
endforeach;
Thank you for contacting us. Where exactly is the problem happening? When I access the link you posted above I can't see the problem. In my test environment, I tested the following code: