/** * Removes completely a blog from the network * @since 0.2.0 * @param int $blog_id the blog id */ public static function remove_blog($blog_id) { switch_to_blog($blog_id); $wp_upload_info = wp_upload_dir(); $dir = str_replace(' ', "\\ ", trailingslashit($wp_upload_info['basedir'])); restore_current_blog(); wpmu_delete_blog($blog_id, true); // wpmu_delete_blog leaves an empty site upload directory, that we want to remove : MUCD_Files::rrmdir($dir); }