hook_image_style_delete

function hook_image_style_delete

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

File

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']);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.api.php/function/hook_image_style_delete/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部