function image_style_flush

Flush cached media for a style.

Parameters

$style: An image style array.

4 calls to image_style_flush()
image_effect_delete in drupal/core/modules/image/image.module
Delete an image effect.
image_effect_save in drupal/core/modules/image/image.module
Save an image effect.
image_image_style_delete in drupal/core/modules/image/image.module
Implements hook_image_style_delete().
image_image_style_update in drupal/core/modules/image/image.module
Implements hook_image_style_update().

File

drupal/core/modules/image/image.module, line 817
Exposes global functionality for creating image styles.

Code

function image_style_flush($style) {
  $style_directory = drupal_realpath(file_default_scheme() . '://styles/' . $style
    ->id());
  if (is_dir($style_directory)) {
    file_unmanaged_delete_recursive($style_directory);
  }

  // Let other modules update as necessary on flush.
  module_invoke_all('image_style_flush', $style);

  //  // Clear image style and effect caches.
  //  cache()->delete('image_styles');
  //  cache()->deletePrefix('image_effects:');
  //  drupal_static_reset('image_styles');
  //  drupal_static_reset('image_effects');
  // Clear field caches so that formatters may be added for this style.
  field_info_cache_clear();
  drupal_theme_rebuild();

  // Clear page caches when flushing.
  if (module_exists('block')) {
    cache('block')
      ->deleteAll();
  }
  cache('page')
    ->deleteAll();
}