function hook_image_style_flush

Respond to image style flushing.

This hook enables modules to take effect when a style is being flushed (all images are being deleted from the server and regenerated). Any module-specific caches that contain information related to the style should be cleared using this hook. This hook is called whenever a style is updated, deleted, or any effect associated with the style is update or deleted.

Parameters

Drupal\image\Plugin\Core\Entity\ImageStyle $style: The image style array that is being flushed.

Related topics

1 invocation of hook_image_style_flush()
image_style_flush in drupal/core/modules/image/image.module
Flush cached media for a style.

File

drupal/core/modules/image/image.api.php, line 80
Hooks related to image styles and effects.

Code

function hook_image_style_flush($style) {

  // Empty cached data that contains information about the style.
  cache('mymodule')
    ->deleteAll();
}