function hook_entity_bundle_delete

Act on entity_bundle_delete().

This hook is invoked after the operation has been performed.

Parameters

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

string $bundle: The bundle that was just deleted.

Related topics

2 functions implement hook_entity_bundle_delete()

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

entity_entity_bundle_delete in drupal/core/modules/entity/entity.module
Implements hook_entity_bundle_delete().
field_entity_bundle_delete in drupal/core/modules/field/field.attach.inc
Implements hook_entity_bundle_delete().

File

drupal/core/includes/entity.api.php, line 130
Hooks provided the Entity module.

Code

function hook_entity_bundle_delete($entity_type, $bundle) {

  // Remove the settings associated with the bundle in my_module.settings.
  $config = config('my_module.settings');
  $bundle_settings = $config
    ->get('bundle_settings');
  if (isset($bundle_settings[$entity_type][$bundle])) {
    unset($bundle_settings[$entity_type][$bundle]);
    $config
      ->set('bundle_settings', $bundle_settings);
  }
}