| 5 node.module | node_type_delete($type) |
| 6 node.module | node_type_delete($type) |
| 7 node.module | node_type_delete( |
| 8 node.module | node_type_delete($name) |
Deletes a node type from the database.
Parameters
$type: The machine-readable name of the node type to be deleted.
2 calls to node_type_delete()
File
- modules/
node/ node.module, line 524 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
function node_type_delete($type) {
$info = node_get_types('type', $type);
db_query("DELETE FROM {node_type} WHERE type = '%s'", $type);
module_invoke_all('node_type', 'delete', $info);
}
Login or register to post comments
Comments
I am not sure, but I believe
I am not sure, but I believe node_types_rebuild() needs to be run after this function has been called. I found that deleting a node type can leave remnants of the node type in the caches, so running the rebuild function ensures that everything is rebuilt properly including the cache.
This requirement is not documented anywhere.