I added the code to my functions file and tried deleting the events from the WP admin area. I got the “error moving to trash” page.
I tried deactivating the events and iCal plugin, and got a server error. Removing the above code from the functions, I was able to restore access to the site. I can’t say if it’s related or not. I’ve been having other issues with the server.
I did see that the events were deleted despite the error message. Having reactivated both plugins, and setting up the import again, when I ran it, it found 10 items but didn’t save or update them.
Now, when I go the the events page, I am getting a 404 error as well.