function linkchecker_entity_language in Link checker 7
Returns the language code of the given entity.
Backward compatibility layer to ensure that installations running an older version of core where entity_language() is not avilable do not break.
Parameters
string $entity_type: An entity type.
object $entity: An entity object.
Return value
string The entity language code.
1 call to linkchecker_entity_language()
- _linkchecker_parse_fields in ./
linkchecker.module - Parse the urls from entity.
File
- ./
linkchecker.module, line 2689 - This module periodically check links in given node types, blocks etc.
Code
function linkchecker_entity_language($entity_type, $entity) {
$langcode = NULL;
if (function_exists('entity_language')) {
$langcode = entity_language($entity_type, $entity);
}
elseif (!empty($entity->language)) {
$langcode = $entity->language;
}
return $langcode;
}