function file_field_delete

Implements hook_field_delete().

1 call to file_field_delete()
image_field_delete in drupal/core/modules/image/image.field.inc
Implements hook_field_delete().

File

drupal/core/modules/file/file.field.inc, line 271
Field module functionality for the File module.

Code

function file_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) {

  // Delete all file usages within this entity.
  foreach ($items as $delta => $item) {
    file_usage()
      ->delete(file_load($item['fid']), 'file', $entity_type, $entity
      ->id(), 0);
  }
}