hook_field_attach_delete_bundle

7 field.api.php hook_field_attach_delete_bundle($entity_type, $bundle, $instances)
8 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()

1 invocation of hook_field_attach_delete_bundle()

File

modules/field/field.api.php, line 1547

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);
  }
}
Login or register to post comments