Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ImageHooks.php

function ImageHooks::filePredelete

Implements hook_ENTITY_TYPE_predelete() for file entities.

File

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

Class

ImageHooks
Hook implementations for image.

Namespace

Drupal\image\Hook

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal