function node_type_delete

Deletes a node type from the database.

Parameters

$name: The machine name of the node type to delete.

2 calls to node_type_delete()
EntityDisplayTest::testRenameDeleteBundle in drupal/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php
Tests renaming and deleting a bundle.
node_type_delete_confirm_submit in drupal/core/modules/node/content_types.inc
Form submission handler for node_type_delete_confirm().

File

drupal/core/modules/node/node.module, line 625
The core module that allows content to be submitted to the site.

Code

function node_type_delete($name) {
  $type = node_type_load($name);
  db_delete('node_type')
    ->condition('type', $name)
    ->execute();
  entity_invoke_bundle_hook('delete', 'node', $name);
  module_invoke_all('node_type_delete', $type);

  // Clear the node type cache.
  node_type_cache_reset();
}