W3cubDocs

/Drupal 8

function image_file_predelete

image_file_predelete(File $file)

Implements hook_ENTITY_TYPE_predelete() for file entities.

File

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

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!image!image.module/function/image_file_predelete/8.1.x