function hook_field_attach_delete_bundle

7.x field.api.php hook_field_attach_delete_bundle($entity_type, $bundle, $instances)

Act on field_attach_delete_bundle.

This hook is invoked after the field module has performed the operation.

Parameters

$entity_type: The type of entity; for example, 'node' or 'user'.

$bundle: The bundle that was just deleted.

$instances: An array of all instances that existed for the bundle before it was deleted.

Related topics

1 function implements hook_field_attach_delete_bundle()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_test_field_attach_delete_bundle in drupal-7.x/modules/field/tests/field_test.storage.inc
Implements hook_field_attach_delete_bundle().
1 invocation of hook_field_attach_delete_bundle()
field_attach_delete_bundle in drupal-7.x/modules/field/field.attach.inc
Notify field.module the a bundle was deleted.

File

drupal-7.x/modules/field/field.api.php, line 1595

Code

function hook_field_attach_delete_bundle($entity_type, $bundle, $instances) {
  // Remove the extra weights variable information for this bundle.
  $extra_weights = variable_get('field_extra_weights', array());
  if (isset($extra_weights[$entity_type][$bundle])) {
    unset($extra_weights[$entity_type][$bundle]);
    variable_set('field_extra_weights', $extra_weights);
  }
}