block_content_entity_type_alter

block_content_entity_type_alter(array &$entity_types)

Implements hook_entity_type_alter().

File

core/modules/block_content/block_content.module, line 57
Allows the creation of custom blocks through the user interface.

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);
  }
}
doc_Drupal
2016-10-29 08:47:52
Comments
Leave a Comment

Please login to continue.