Implements hook_field_delete().
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);
}
}