You are here

function styles_style_flush in Styles 7.2

Flush cached defaults for a style.

Parameters

$style: A style array.

5 calls to styles_style_flush()
file_styles_image_style_delete in contrib/file_styles/file_styles.module
Implements hook_image_style_delete().
file_styles_image_style_save in contrib/file_styles/file_styles.module
Implements hook_image_style_save().
styles_style_delete in ./styles.module
styles_style_save in ./styles.module
styles_style_save_preset in ./styles.module
Save a style/preset instance.

File

./styles.module, line 706
Bundles similar display formatters together.

Code

function styles_style_flush($style = NULL) {

  // Clear style and preset caches.
  cache_clear_all('styles_default_styles', 'cache_styles');
  cache_clear_all('styles_default_presets', 'cache_styles');
  cache_clear_all('styles_default_containers', 'cache_styles');
  drupal_static_reset('styles_default_styles');
  drupal_static_reset('styles_default_presets');
  drupal_static_reset('styles_default_containers');
  drupal_static_reset('styles_get_registered_classes');

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

  // 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_clear_all('*', 'cache_block', TRUE);
  }
  cache_clear_all('*', 'cache_page', TRUE);
}