Skip to content

Instantly share code, notes, and snippets.

@QuentinFonteneau
Created January 19, 2018 13:26
Show Gist options
  • Save QuentinFonteneau/651a6af653dbc478f9603d7b1b6d7603 to your computer and use it in GitHub Desktop.
Save QuentinFonteneau/651a6af653dbc478f9603d7b1b6d7603 to your computer and use it in GitHub Desktop.
Flush all image styles in Drupal 8
$imageStyle = \Drupal::entityTypeManager()->getStorage('image_style');
$styles = $imageStyle->loadMultiple();
foreach ($styles as $style) {
$imageStyle->load($style->get('name'))->flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment