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

Breadcrumb

  1. Drupal Core 11.1.x
  2. image.module

function 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);
    }
}
RSS feed
Powered by Drupal