1.20.x image.module | image_style_delete($style, $replacement_style_name = '') |
Delete an image style.
Parameters
$style: An image style array.
$replacement_style_name: (optional) When deleting a style, specify a replacement style name so that existing settings (if any) may be converted to a new style.
Return value
TRUE on success.:
File
- modules/
image/ image.module, line 629 - Exposes global functionality for creating image styles.
Code
function image_style_delete($style, $replacement_style_name = '') {
image_style_flush($style);
$config = config('image.style.' . $style['name']);
$config->delete();
// Let other modules update as necessary on save.
$style['old_name'] = $style['name'];
$style['name'] = $replacement_style_name;
module_invoke_all('image_style_delete', $style);
return TRUE;
}