Custom row action on custom posts list page causes a wp_die?

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=jobaction=mark-specialjob_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?

Topic row-actions hacks Wordpress

Category Web


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!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.