You are here

function image_file_predelete in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/image/image.module \image_file_predelete()
  2. 10 core/modules/image/image.module \image_file_predelete()

Implements hook_ENTITY_TYPE_predelete() for file entities.

File

core/modules/image/image.module, line 183
Exposes global functionality for creating image styles.

Code

function image_file_predelete(FileInterface $file) {

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