About that, why not use `wp_delete_post()`? It takes care of everything.