wphooks.info - delete_blog

delete_blog

The hook occurs in the following file:

wp-admin/includes/ms.php:
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	$blog = get_site( $blog_id );
	/**
	 * Fires before a site is deleted.
	 *
	 * @since MU
	 *
	 * @param int  $blog_id The site ID.
	 * @param bool $drop    True if site's table should be dropped. Default is false.
	 */
	do_action( 'delete_blog', $blog_id, $drop );

	$users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) );

	// Remove users from this blog.
	if ( ! empty( $users ) ) {
		foreach ( $users as $user_id ) {
			remove_user_from_blog( $user_id, $blog_id );
		}
	}