1 filter.module _filter_delete_file_usage(array $fids, EntityInterface $entity, $count)

Deletes file usage of files referenced by processed text fields.


array $fids: An array of file entity IDs.

EntityInterface $entity: An entity whose fields to inspect for file references.

$count: The number of references to delete. Should be 1 when deleting a single revision and 0 when deleting an entity entirely.


core/modules/filter/filter.module, line 1811
Framework for handling the filtering of content.


function _filter_delete_file_usage(array $fids, EntityInterface $entity, $count) {
  foreach ($fids as $fid) {
    if ($file = file_load($fid)) {
      file_usage_delete($file, 'filter', $entity->entityType(), $entity->id(), $count);