I want to move a post in trash but the condition is that simultaneously I need to delete some more posts. Sample Code:

jQuery(function($) {
    $('#delete-action a').unbind();
    $('#delete-action a').click(function(event) {
    openbox('Trash Child Posts', 1);
            function() {
                $('#save-action .spinner').hide();

It pop ups a new popup to delete the child post.

    var trash_blog = $('div#trash-button');
$("#trash-button").click( function()
        var allVals = [];
        $('div#box :checked').each(function() {


Now the problem: How to bypass the nonce value when window.location executes?
After redirection it says 'Are you Sure to do this, Please try again' because nonce value doesn't match.

  • Show how you add the nonce and how you check it. The problem isn't your javascript code. – kaiser Apr 30 '13 at 12:22
  • Still I am not creating the nonce. I want to ask how can we do that so I can pass nonce through java script. – Sumit Apr 30 '13 at 12:53
  • See WordPress Nonces -> Related in Codex – kaiser Apr 30 '13 at 13:34
  • Вo you need additional deletion logic to run in JS? Why not implement it on PHP level, using hooks? – Rarst Apr 30 '13 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.