function hook_entity_bundle_info

Describe the bundles for entity types.

Return value

array An associative array of all entity bundles, keyed by the entity type name, and then the bundle name, with the following keys:

  • label: The human-readable name of the bundle.
  • uri_callback: The same as the 'uri_callback' key defined for the entity type in the EntityManager, but for the bundle only. When determining the URI of an entity, if a 'uri_callback' is defined for both the entity type and the bundle, the one for the bundle is used.
  • translatable: (optional) A boolean value specifying whether this bundle has translation support enabled. Defaults to FALSE.

See also

entity_get_bundles()

hook_entity_bundle_info_alter()

Related topics

9 functions implement hook_entity_bundle_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

book_entity_bundle_info in drupal/core/modules/book/book.module
Implements hook_entity_bundle_info().
comment_entity_bundle_info in drupal/core/modules/comment/comment.module
Implements hook_entity_bundle_info().
contact_entity_bundle_info in drupal/core/modules/contact/contact.module
Implements hook_entity_bundle_info().
custom_block_entity_bundle_info in drupal/core/modules/block/custom_block/custom_block.module
Implements hook_entity_bundle_info().
menu_entity_bundle_info in drupal/core/modules/menu/menu.module
Implements hook_entity_bundle_info().

... See full list

1 invocation of hook_entity_bundle_info()
entity_get_bundles in drupal/core/includes/entity.inc
Returns the entity bundle info.

File

drupal/core/includes/entity.api.php, line 63
Hooks provided the Entity module.

Code

function hook_entity_bundle_info() {
  $bundles['user']['user']['label'] = t('User');
  return $bundles;
}