1 comment

  1. The Core “trash post” links in the “Quick Edit” section on edit.php and in the “advanced” form in the “Publish” meta box work over GET not POST. Unless you have altered the form(s) somehow, there is no POST data. All you have is the post ID.

    To save data when a post is deleted, you won’t be able to use the default “delete/trash” functionality. You will need to:

    1. Save your post with the (I assume) custom meta field “delete/trash”
      description, then trash the post.
    2. Submit your “delete/trash” description via AJAX either when you fill
      out the description or when you hit the “delete/trash” link.
    3. Alter the form so that the “delete/trash” link submits the whole
      form over POST
    4. Remove the “delete/trash” links and replace them with a checkbox so
      that you can submit the form as normal and if the “delete/trash”
      checkbox is checked a filter on save_post can do the actual delete.

    Off the top of my head, I can’t tell you how hard modifying the form will be, but it won’t likely be simple. The AJAX options are probably easier, but can easily be disabled by switching off Javascript in the browser.

Comments are closed.