1 file.field.inc file_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items)

Implements hook_field_delete().

File

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

Code

function file_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

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