function block_content_entity_type_alter

Same name and namespace in other branches
  1. 9 core/modules/block_content/block_content.module \block_content_entity_type_alter()
  2. 10 core/modules/block_content/block_content.module \block_content_entity_type_alter()

Implements hook_entity_type_alter().

File

core/modules/block_content/block_content.module, line 61

Code

function block_content_entity_type_alter(array &$entity_types) {
  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  // Add a translation handler for fields if the language module is enabled.
  if (\Drupal::moduleHandler()->moduleExists('language')) {
    $translation = $entity_types['block_content']->get('translation');
    $translation['block_content'] = TRUE;
    $entity_types['block_content']->set('translation', $translation);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.