1 image_example.module image_example_image_style_save($style)

Implements hook_image_style_save().

Allows modules to respond to updates to an image style's settings.

Related topics


modules/examples/image_example/image_example.module, line 72
Hooks implementations for the Image Example module.


function image_example_image_style_save($style) {
  // The $style parameter is an image style array with one notable exception.
  // When a user has chosen to replace a deleted style with another style the
  // $style['name'] property contains the name of the replacement style and
  // $style['old_name'] contains the name of the style being deleted.
  // Here we update a variable that contains the name of the image style that
  // the block provided by this module uses when formatting images to use the
  // new user chosen style name.
  if (isset($style['old_name']) && $style['old_name'] == config_get('image_example.settings', 'image_example_style_name')) {
    config_set('image_example.settings', 'image_example_style_name', $style['name']);