Is it possible to run plugin code when a multisite blog is deleted?

I have a plugin that creates tables when activated or when a new blog is added to a network. When a blog is deleted I would like to be able to remove those tables for that blog. Is there a hook available to do this?

I imagine it would be something similar to wpmu_new_blog, but I can’t find an equivalent for deleting.

2 Answers
2

The function wpmu_delete_blog in /wp-admin/includes/ms.php has an action hook called delete_blog. This hook passes the variable of $blog_id

You could try plugging into that hook, although it is executed right at the beginning of the function.

Leave a Comment