• Hello everybody!

    I customized the publish metabox to provide additional options for the user. If the user clicks “move to trash” a checkbox shows up.

    The hook wp_trash_post works fine but I can’t seem to get the values from the checkbox. As a comparison the save_post hook works just fine and I can get the value with $_POST[‘value’].

    Any help is appreciated.

    Best regards, Stefan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    It works with save_post because it is triggered by a form submit. The “move to trash” is a simple link, so it results in a GET request, not POST. You’ll need to get the checkbox status added as an url parameter to the “move to trash” link and then retrieve it from the resulting $_GET array. You should be able to do this with javascript or jquery.

    Thread Starter stefan2k

    (@stefan2k)

    Aweseome … works like a charm 🙂

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get checkbox values on delete’ is closed to new replies.