Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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