function _imagecache_preset_flush in ImageCache 5
Flush cached media for a preset.
Parameters
id: A preset id.
4 calls to _imagecache_preset_flush()
- imagecache_admin_submit in ./
imagecache.module - _imagecache_action_delete in ./
imagecache.module - _imagecache_preset_delete in ./
imagecache.module - _imagecache_preset_update in ./
imagecache.module - Update a preset.
File
- ./
imagecache.module, line 555 - Dynamic image resizer and image cacher.
Code
function _imagecache_preset_flush($id) {
if (user_access('flush imagecache')) {
drupal_set_message(t('Flushed Preset Images (ID: @id)', array(
'@id' => $id,
)));
$preset = _imagecache_preset_load($id);
$presetdir = realpath(file_directory_path() . '/imagecache/' . $preset);
if (is_dir($presetdir)) {
_imagecache_recursive_delete($presetdir);
}
}
}