function language_hierarchy_get_parent in Language Hierarchy 7
Returns parent language of the provided language.
Parameters
$langcode: Code of language you want to retrieve parent of.
Return value
mixed Parent language, NULL otherwise
2 calls to language_hierarchy_get_parent()
- LanguageHierarchyI18nVariableLanguageRealm::getParentRealmStore in modules/
i18n_variable_hierarchy/ includes/ i18n_variable_hierarchy.class.inc - Get a reference to the parent realm's store.
- language_hierarchy_get_ancestors in ./
language_hierarchy.module - Returns ancestors language code of the provided language.
File
- ./
language_hierarchy.module, line 311
Code
function language_hierarchy_get_parent($langcode) {
$languages = language_list();
if (isset($languages[$langcode]) && !empty($languages[$langcode]->parent) && isset($languages[$languages[$langcode]->parent])) {
return $languages[$languages[$langcode]->parent];
}
else {
return NULL;
}
}