function editor_field_attach_delete_revision in Editor 7
Implements hook_field_attach_delete_revision().
File
- includes/
editor.file_usage.inc, line 25 - Tracks usage of embedded files.
Code
function editor_field_attach_delete_revision($entity_type, $entity) {
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
$files = editor_entity_field_count_files($entity_type, $entity);
foreach ($files as $fid => $count) {
if ($file = file_load($fid)) {
file_usage_delete($file, 'editor', $entity_type, $id, $count);
}
}
}