You are here

function editor_entity_insert in Drupal 8

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

Implements hook_entity_insert().

File

core/modules/editor/editor.module, line 366
Adds bindings for client-side "text editors" to text formats.

Code

function editor_entity_insert(EntityInterface $entity) {

  // Only act on content entities.
  if (!$entity instanceof FieldableEntityInterface) {
    return;
  }
  $referenced_files_by_field = _editor_get_file_uuids_by_field($entity);
  foreach ($referenced_files_by_field as $field => $uuids) {
    _editor_record_file_usage($uuids, $entity);
  }
}