This page redirects to an external site: https://developer.wordpress.org/reference/hooks/deactivate_blog/
deactivate_blog is an action triggered whenever an existing blog is deactivated within a multisite network.
<?php add_action( 'deactivate_blog', 'function_name' ); ?>
where "function_name" is the name of the function to be called.
Within a class, use the following syntax;
<?php add_action( 'deactivate_blog', array( $this, 'function_name' ) ); ?>
/**
* Example of deactivate_blog usage
*
* @param int $id Blog ID of the blog being deactivated.
*/
function wporg_deactivate_blog_example( $id ) {
if ( 5 == $id ) {
// Update some option or something
}
}
add_action( 'deactivate_blog', 'wporg_deactivate_blog_example' );
The deactivate_blog hook is found in wp-admin/network/sites.php.