I'm trying to delete some content types which are no longer used but are still active.
I'm going to deploy the update using hook_update_N
and have this so far (Code taken from node_type_delete_confirm_submit
:
function hook_update_N(&$sandbox) {
node_type_delete('mynodetype');
variable_del('node_preview_mynodetype');
node_types_rebuild();
menu_rebuild();
}
The problem I'm having is that the node type is deleted, but the nodes of that type are still there in the database. Running cron hasn't deleted those nodes (I'm not even sure if that's the default behavior when deleting content types through the admin UI)
My question is:
- Are the nodes deleted automatically after a certain time through Cron or some other method? If not then doing it manually, would it be best to do it before deleting the content type or after?