function getlocations_fields_field_delete_revision in Get Locations 7
Same name and namespace in other branches
- 7.2 modules/getlocations_fields/getlocations_fields.module \getlocations_fields_field_delete_revision()
Implements hook_field_delete_revision(). Define custom revision delete behavior for this module's field types.
Parameters
$entity_type: The type of $entity.
$entity: The entity for the operation.
$field: The field structure for the operation.
$instance: The instance structure for $field on $entity's bundle.
$langcode: The language associated with $items.
$items: $entity->{$field['field_name']}[$langcode], or an empty array if unset.
File
- modules/
getlocations_fields/ getlocations_fields.module, line 412 - getlocations_fields.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_fields_field_delete_revision($entity_type, $entity, $field, $instance, $langcode, &$items) {
if (!empty($items)) {
if ($entity_type == 'node') {
$criteria = array(
'field_name' => $field['field_name'],
'vid' => $entity->vid,
);
$items = getlocations_fields_save_locations($items, $criteria, FALSE, 'delete_revision');
}
}
}