Searched words:
drupal 7 programmatic delete content type
This is what i put as an update hook in a .install file:
<?php
/**
* Delete unused content types.
*
* Adapted from node_type_delete_confirm_submit().
*/
function anjaliup_update_7005() {
$types = array(
'simplenews',
);
foreach(
$types as $type) {
node_type_delete('simplenews');
variable_del('node_preview_'. $type);
}
node_types_rebuild();
menu_rebuild();
}
?>
Not tested yet.