function ImageDerivativeUtilities::pathFlush

Same name and namespace in other branches
  1. main core/modules/image/src/ImageDerivativeUtilities.php \Drupal\image\ImageDerivativeUtilities::pathFlush()

Clears cached versions of a specific file in all styles.

Parameters

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

File

core/modules/image/src/ImageDerivativeUtilities.php, line 23

Class

ImageDerivativeUtilities
Image style flush and options utilities.

Namespace

Drupal\image

Code

public function pathFlush(string $path) : void {
  $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.