1 image.module | image_field_delete_instance($instance) |
Implements hook_field_delete_instance().
File
- core/
modules/ image/ image.module, line 429 - Exposes global functionality for creating image styles.
Code
function image_field_delete_instance($instance) {
// Only act on image fields.
$field = field_read_field($instance['field_name']);
if ($field['type'] != 'image') {
return;
}
// Remove the default image when the instance is deleted.
$uri = $instance['settings']['default_image'];
if ($uri && file_exists($uri)) {
file_unmanaged_delete($uri);
}
}