Skip to content

Instantly share code, notes, and snippets.

@batandwa
Last active January 2, 2016 17:29
Show Gist options
  • Save batandwa/8336978 to your computer and use it in GitHub Desktop.
Save batandwa/8336978 to your computer and use it in GitHub Desktop.
Drupal 7 - Removes all the style images generated so new ones can be created when needed.
<?php
module_load_include('module', 'image');
$styles = array_keys(image_styles());
image_style_flush($styles);
drupal_set_message(t('Flushed images for the following styles: %styles.', array('%styles' => implode(', ', $styles))), 'status', FALSE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment