You are here

function field_group_field_attach_delete_bundle in Field Group 7

Same name and namespace in other branches
  1. 7.2 field_group.module \field_group_field_attach_delete_bundle()

Implements hook_field_attach_delete_bundle().

Parameters

String $entity_type:

String $bundle:

File

./field_group.module, line 240
Fieldgroup module.

Code

function field_group_field_attach_delete_bundle($entity_type, $bundle) {
  ctools_include('export');
  $list = field_group_read_groups(array(
    'bundle' => $bundle,
    'entity_type' => $entity_type,
  ));

  // Delete the entity's entry from field_group of all entities.
  // We fetch the field groups first to assign the removal task to ctools.
  if (isset($list[$entity_type], $list[$entity_type][$bundle])) {
    foreach ($list[$entity_type][$bundle] as $groups) {
      foreach ($groups as $group) {
        ctools_export_crud_delete('field_group', $group);
      }
    }
  }
}