I have a multi-site network, and want to secure the /wp-admin/ms-delete-site.php so that it does not execute. We want to manage site deletions from the command line only.
I have added a call to wp_die() at the top for now, but I would prefer to handle this in a plugin, and not make any changes to the WP core files.
What is the best way to implement this in a plugin?
2 Answers
Another alternative is to look at the hook map_meta_cap and remove the user’s capability to delete_site
. If you have a restricted set of users or context when you want to allow delete_site
then you can allow the capability.