function hook_file_delete

Respond to a file being deleted.


$file: The file that has just been deleted.

See also


Related topics

5 functions implement hook_file_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_crud_hook_test_file_delete in drupal/modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_file_delete().
file_file_delete in drupal/modules/file/file.module
Implements hook_file_delete().
file_test_file_delete in drupal/modules/simpletest/tests/file_test.module
Implements hook_file_delete().
image_file_delete in drupal/modules/image/image.module
Implements hook_file_delete().
user_file_delete in drupal/modules/user/user.module
Implements hook_file_delete().
1 invocation of hook_file_delete()
file_delete in drupal/includes/
Deletes a file and its database record.


drupal/modules/system/system.api.php, line 2984
Hooks provided by Drupal core and the System module.


function hook_file_delete($file) {

  // Delete all information associated with the file.
    ->condition('fid', $file->fid)