0

The scenario is this:

I have a CPT called Job. I've set custom row actions for this CPT, and most of them are linked to external or custom settings pages. They work fine.

Now I've set a new row action, called as 'mark-special', and I've set the href for the link as the same posts list page with my own params as:

edit.php?post_type=job&action=mark-special&job_id=123&_wpnonce=<custom nonce>

I'm handling the action in a function hooked with init.

The problem is, when I click this link, it wp_dies with a message: Are you sure you want to do this?. But the function works as I want it to, and the CPT is set as special.

Any way I can solve this?

0

Found the issue. I have used action as a url arg, which WP uses for all its actions such as approve_comment, trash_post etc. Changed it to a custom word and my code worked like a charm!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.