function image_path_flush

Same name in other branches
  1. 7.x modules/image/image.module \image_path_flush()
  2. 9 core/modules/image/image.module \image_path_flush()
  3. 8.9.x core/modules/image/image.module \image_path_flush()
  4. 10 core/modules/image/image.module \image_path_flush()

Clears cached versions of a specific file in all styles.

Parameters

$path: The Drupal file path to the original image.

2 calls to image_path_flush()
ImageHooks::fileMove in core/modules/image/src/Hook/ImageHooks.php
Implements hook_file_move().
ImageHooks::filePredelete in core/modules/image/src/Hook/ImageHooks.php
Implements hook_ENTITY_TYPE_predelete() for file entities.

File

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

Code

function image_path_flush($path) {
    $styles = ImageStyle::loadMultiple();
    foreach ($styles as $style) {
        $style->flush($path);
    }
}

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