bp_admin_list_table_current_bulk_action

When using a WP_List_Table, get the currently selected bulk action.

Description

(string) bp_admin_list_table_current_bulk_action(); 

WP_List_Tables have bulk actions at the top and at the bottom of the tables, and the inputs have different keys in the $_REQUEST array. This function reconciles the two values and returns a single action being performed.

Returns (string)


Usage

  1. if ( !function_exists( 'bp_admin_list_table_current_bulk_action' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_admin_list_table_current_bulk_action(); 
  7.  

Defined (1)

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

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_admin_list_table_current_bulk_action() { 
  2.  
  3. $action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; 
  4.  
  5. // If the bottom is set, let it override the action. 
  6. if ( ! empty( $_REQUEST[''] ) && $_REQUEST[''] != "-1" ) { 
  7. $action = $_REQUEST['']; 
  8.  
  9. return $action;