function hook_field_attach_rename_bundle

7.x field.api.php hook_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)

Act on field_attach_rename_bundle().

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

See field_attach_rename_bundle() for details and arguments.

Related topics

3 functions implement hook_field_attach_rename_bundle()

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

field_sql_storage_field_attach_rename_bundle in drupal/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_attach_rename_bundle().
field_test_field_attach_rename_bundle in drupal/modules/field/tests/field_test.storage.inc
Implements hook_field_attach_rename_bundle().
field_ui_field_attach_rename_bundle in drupal/modules/field_ui/field_ui.module
Implements hook_field_attach_rename_bundle().
1 invocation of hook_field_attach_rename_bundle()
field_attach_rename_bundle in drupal/modules/field/field.attach.inc
Notify field.module that a bundle was renamed.

File

drupal/modules/field/field.api.php, line 1608
Hooks provided by the Field module.

Code

function hook_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
  // Update the extra weights variable with new information.
  if ($bundle_old !== $bundle_new) {
    $extra_weights = variable_get('field_extra_weights', array());
    if (isset($info[$entity_type][$bundle_old])) {
      $extra_weights[$entity_type][$bundle_new] = $extra_weights[$entity_type][$bundle_old];
      unset($extra_weights[$entity_type][$bundle_old]);
      variable_set('field_extra_weights', $extra_weights);
    }
  }
}