function ImageHooks::fileMove

Implements hook_file_move().

Attributes

#[Hook('file_move')]

File

core/modules/image/src/Hook/ImageHooks.php, line 228

Class

ImageHooks
Hook implementations for image.

Namespace

Drupal\image\Hook

Code

public function fileMove(FileInterface $file, FileInterface $source) : void {
  // Delete any image derivatives at the original image path.
  image_path_flush($source->getFileUri());
}

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