In a plugin which shows a table of posts of a custom type, I wanted to add the option for bulk actions. Besides the checkboxes I displayed the control for bulk actions, but when I click Apply
, nothing happens.
It’s supposed to be an action, I guess, but I couldn’t find which one. I tried trash_post
, but it doesn’t get hit.
How do I perform a bulk delete anyway, since I’ve no idea if I’m even on the right track.
You will have to define your bulk actions array in your class that extends WP_List_Table then in your display function you will need to define the individual actions.
You can use wp_posts_list_table as an example of how it’s done:
You also have to add the javascript to make the ajax requests and fill in the data from the hidden inline_ div. Take a look or reuse the code from inline-edit-post-dev.js.