function hook_image_style_delete

7.x image.api.php hook_image_style_delete($style)

Respond to image style deletion.

This hook enables modules to update settings when a image style is being deleted. If a style is deleted, a replacement name may be specified in $style['name'] and the style being deleted will be specified in $style['old_name'].

Parameters

$style: The image style array that being deleted.

Related topics

2 functions implement hook_image_style_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

image_image_style_delete in drupal/modules/image/image.module
Implements hook_image_style_delete().
user_image_style_delete in drupal/modules/user/user.module
Implements hook_image_style_delete().
1 invocation of hook_image_style_delete()
image_style_delete in drupal/modules/image/image.module
Deletes an image style.

File

drupal/modules/image/image.api.php, line 97
Hooks related to image styles and effects.

Code

function hook_image_style_delete($style) {
  // Administrators can choose an optional replacement style when deleting.
  // Update the modules style variable accordingly.
  if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) {
    variable_set('mymodule_image_style', $style['name']);
  }
}