On this page
function hook_field_attach_delete_bundle
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
- modules/field/field.api.php, line 1633
- 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 = 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);
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_attach_delete_bundle/7.x