This article was originally published i@ wptavern.com
WordPress 4.7 will allow for custom bulk actions in admin list tables, an exciting new feature for developers. List tables are found on various screens throughout the admin. Bulk actions are the dropdowns that let users perform actions such as activate or deactivate plugins in bulk, move multiple posts to the trash, and bulk delete media items.
The ability for developers to filter bulk actions was introduced in 3.1 but it didn’t offer much flexibility. Up until 4.7, it only allowed for the removal of items from default bulk actions. The upcoming release will make it possible for developers to register new bulk actions for any admin list table dropdown, including the Attachments list table.
Eric Andrew Lewis posted the announcement on the make.wordpress/core blog along with a sample code walkthrough of the steps required for adding a new option to the dropdown, handling a bulk action form submission, and displaying notices to inform users of what happened. The announcement was met with a round of cheers from developers who are delighted to make use of the new ability to register their own bulk actions.
This small, yet important change resolves a six-year-old ticket and has the potential to impact many plugins. For example, the Custom Bulk Actions plugin has been rendered obsolete, as core now provides a better standard. There are many other plugins that register bulk actions through a similar method or another type of hack, but WordPress 4.7 will offer an easier, core-supported way to accomplish this.