Snippets Collections
global $language;
$lang = $language->language;
$base_node = node_load(XXXXX);

$translations = translation_node_get_translations($base_node->tnid);
$translated_node = (isset($translations[$lang])?node_load($translations[$lang]->nid):$base_node);
star

Fri Sep 03 2021 09:25:59 GMT+0000 (Coordinated Universal Time) https://api.drupal.org/api/drupal/modules%21translation%21translation.module/function/translation_node_get_translations/7.x

#drupal #drupal7 #node #translation #languages

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension