function image_field_delete_field

7.x image.module image_field_delete_field($field)

Implements hook_field_delete_field().

File

drupal/modules/image/image.module, line 423
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']);
  }
}