You are here

function entity_translation_enabled_bundle in Entity Translation 7

Determines whether the given entity bundle is translatable.

NOTE: Does not check for whether the entity type is translatable. Consider using entity_translation_enabled() instead.

Parameters

$entity_type: The entity type the bundle to be checked belongs to.

$bundle: The name of the bundle to be checked.

5 calls to entity_translation_enabled_bundle()
entity_translation_admin_form in ./entity_translation.admin.inc
Builder function for the entity translation settings form.
entity_translation_enabled in ./entity_translation.module
Determines whether the given entity type is translatable.
entity_translation_field_extra_fields in ./entity_translation.module
Implements hook_field_extra_fields().
entity_translation_form_taxonomy_form_vocabulary_alter in ./entity_translation.taxonomy.inc
Implements hook_form_FORM_ID_alter()
entity_translation_settings_init in ./entity_translation.admin.inc
Applies the given settings to every defined bundle.

File

./entity_translation.module, line 1816

Code

function entity_translation_enabled_bundle($entity_type, $bundle) {
  $info = entity_get_info($entity_type);
  $bundle_callback = isset($info['translation']['entity_translation']['bundle callback']) ? $info['translation']['entity_translation']['bundle callback'] : FALSE;
  return empty($bundle_callback) || call_user_func($bundle_callback, $bundle);
}