function content_type_delete in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 5 content_crud.inc \content_type_delete()
- 6.3 includes/content.crud.inc \content_type_delete()
- 6.2 includes/content.crud.inc \content_type_delete()
Make changes needed when a content type is deleted.
Parameters
$info: value supplied by hook_node_type()
1 call to content_type_delete()
- content_node_type in ./
content.module - Implementation of hook_node_type() React to change in node types
File
- includes/
content.crud.inc, line 582 - Create/Read/Update/Delete functions for CCK-defined object types.
Code
function content_type_delete($info) {
$fields = content_field_instance_read(array(
'type_name' => $info->type,
));
foreach ($fields as $field) {
content_field_instance_delete($field['field_name'], $info->type);
}
$table = _content_tablename($info->type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE);
if (db_table_exists($table)) {
$ret = array();
db_drop_table($ret, $table);
watchdog('content', 'The content fields table %name has been deleted.', array(
'%name' => $table,
));
}
content_menu_needs_rebuild(TRUE);
}