function callback_entity_info_label
7.x system.api.php | callback_entity_info_label($entity, $entity_type) |
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
- drupal-7.x/
modules/ system/ system.api.php, line 4760 - Hooks provided by Drupal core and the System module.
Code
function callback_entity_info_label($entity, $entity_type) {
return empty($entity->title) ? 'Untitled entity' : $entity->title;
}