You are here

function text_field_delete in Scald: Media Management made easy 7

Implements hook_field_delete() on behalf of Text module.

See also

text_field_presave()

File

modules/fields/mee/mee.module, line 372
Defines a special textarea, with drag and drop media driven by Scald and dnd.module.

Code

function text_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
  if (!_mee_field_instance_enabled($instance, 'mee')) {
    return;
  }
  list($id, ) = _mee_extract_id($entity_type, $entity);

  // Delete all resource associations for this field.
  db_delete('mee_resource')
    ->condition('entity_type', $entity_type)
    ->condition('entity_id', $id)
    ->condition('field', $field['field_name'])
    ->execute();
}