On this page
function image_field_delete_field
image_field_delete_field($field)
Implements hook_field_delete_field().
File
- modules/image/image.module, line 426
- Exposes global functionality for creating image styles.
Code
function image_field_delete_field($field) {
if ($field['type'] != 'image') {
return;
}
// The value of a managed_file element can be an array if #extended == TRUE.
$fid = (is_array($field['settings']['default_image']) ? $field['settings']['default_image']['fid'] : $field['settings']['default_image']);
if ($fid && ($file = file_load($fid))) {
file_usage_delete($file, 'image', 'default_image', $field['id']);
}
}
© 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.module/function/image_field_delete_field/7.x