You are here

function entityform_block_entity_delete in Entityform block 7

Implements hook_entity_type_delete().

Deletes blocks if the entity type is deleted.

File

./entityform_block.module, line 196
Render any entity form into a block.

Code

function entityform_block_entity_delete($entity, $entity_type) {
  $type = $entity->type;
  if ($entity_type == "entityform_type") {
    $types = variable_get('entityform_block_types');
    if (entityform_block_exists($types, $type)) {
      $key = array_search($type, $types);
      unset($types[$key]);
      variable_set('entityform_block_types', $types);
    }
  }
}