Developers: Register Custom Bulk Actions on List Tables

Sorry it’s been such a long time since my last blog! I’m happy to tell you that in WordPress 4.7, developers can register their own bulk actions on list table screens.
Let’s walk through the steps required to add one.
An option in the dropdown
To add an option in the Bulk Actions dropdown HTML element, register a callback on the bulk_actions-{screen_id} filter that adds the new option onto the array. Replace {screen_id} with the ID of the admin screen to offer the bulk action on.
To add a bulk action “Email to Eric,” we could use the following code:
123456
add_filter( ‘bulk_actions-edit-post’, ‘register_my_bulk_actions’ );function register_my_bulk_actions($bulk_actions) {$bulk_actions[’email_to_eric’] = __( ‘Email to Eric’, ’email_to_eric’);return $bulk_actions;}
Handling the form submission
To handle a bulk action form submission, register a callback on the handle_bulk_actions-{screen_id} filter for the corresponding screen. The filter expects the redirect URL to be modified, so be sure to modify the passed $redirect_url. This allows us to carry success or failure state into the next request to display a notice to the user. The other callback arguments
Source: https://managewp.org/articles/13535/developers-register-custom-bulk-actions-on-list-tables
source https://williechiu40.wordpress.com/2016/10/04/developers-register-custom-bulk-actions-on-list-tables/