function hook_image_style_save
Respond to image style updating.
This hook enables modules to update settings that might be affected by changes to an image. For example, updating a module specific variable to reflect a change in the image style's name.
Parameters
$style: The image style array that is being updated.
Related topics
2 functions implement hook_image_style_save()
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_save in modules/
image/ image.module - Implements hook_image_style_save().
- user_image_style_save in modules/
user/ user.module - Implements hook_image_style_save().
1 invocation of hook_image_style_save()
- image_style_save in modules/
image/ image.module - Saves an image style.
File
-
modules/
image/ image.api.php, line 78
Code
function hook_image_style_save($style) {
// If a module defines an image style and that style is renamed by the user
// the module should update any references to that style.
if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) {
variable_set('mymodule_image_style', $style['name']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.