function image_file_predelete

Same name and namespace in other branches
  1. 9 core/modules/image/image.module \image_file_predelete()
  2. 8.9.x core/modules/image/image.module \image_file_predelete()
  3. 11.x core/modules/image/image.module \image_file_predelete()

Implements hook_ENTITY_TYPE_predelete() for file entities.

File

core/modules/image/image.module, line 210

Code

function image_file_predelete(FileInterface $file) {
    // Delete any image derivatives of this image.
    image_path_flush($file->getFileUri());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.