bulk_actions-<screen_id>

Filters the list table Bulk Actions drop-down.

Description

apply_filters( 'bulk_actions-<screen_id>', (array) $this_actions ); 

The dynamic portion(s) of the hook name refer to the ID of the current screen, usually a string.

This filter can currently only be used to remove bulk actions.

Parameters (1)

0. $this_actions (array)
An array of the available bulk actions.

Usage

To run the hook, copy the example below.
  1. $this_actions = apply_filters( 'bulk_actions-{$screen_id}', $this_actions ); 
  2.  
  3. if ( !empty( $this_actions ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bulk_actions-<screen_id> callback 
  2. function filter_bulk_actions_screen_id( $this_actions ) { 
  3. // make filter magic happen here... 
  4. return $this_actions
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "bulk_actions-{$screen_id}", 'filter_bulk_actions_screen_id', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "bulk_actions-{$screen_id}", 'filter_bulk_actions_screen_id', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/app/helper/class-ms-helper-listtable.php  
  1. $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );