Create your own bulk actions
Including version 4.6 it was quite difficult to add custom bulk actions to the WordPress admin pages. In version 4.7 a hook is added that simplifies the task a lot: add_action(‘bulk_actions-{screen_id}’, ‘my_bulk_action’); Defining the hook As an example we’ll use the post page, the variables are named accordingly. add_filter( ‘bulk_actions-edit-post’, ‘register_my_bulk_actions’ ); Definig the hook function register_my_bulk_actions($bulk_actions) { $bulk_actions[‘my_bulk_action’] = __( ‘My Bulk Action’, ‘domain’); $bulk_actions[‘my_other_bulk_action’] = __( ‘My Other Bulk Action’, ‘domain’); return $bulk_actions; } You can define more… Read More »Create your own bulk actions