1 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 name of the bundle that was just deleted.

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

Related topics

File

core/modules/field/field.api.php, line 1682
Hooks provided by the Field module.

Code

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