function image_field_delete_field
Implements hook_field_delete_field().
File
-
modules/
image/ image.module, line 426
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']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.