function field_entity_create

Implements hook_entity_create().

Related topics

File

drupal/core/modules/field/field.module, line 253
Attach custom data fields to Drupal entities.

Code

function field_entity_create(EntityInterface $entity) {
  $info = $entity
    ->entityInfo();
  if (!empty($info['fieldable'])) {
    foreach ($entity
      ->getTranslationLanguages() as $langcode => $language) {
      field_populate_default_values($entity, $langcode);
    }
  }
}