function callback_entity_info_label
Return the label of an entity.
Callback for hook_entity_info().
Parameters
$entity: The entity for which to generate the label.
$entity_type: The entity type; e.g., 'node' or 'user'.
Return value
An unsanitized string with the label of the entity.
See also
Related topics
File
-
modules/
system/ system.api.php, line 4914
Code
function callback_entity_info_label($entity, $entity_type) {
return empty($entity->title) ? 'Untitled entity' : $entity->title;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.