WP_List_Table::get_bulk_actions() WordPress Method

The WP_List_Table::get_bulk_actions() method is used to get the bulk actions that are available for the current table. This is typically used in conjunction with the WP_List_Table::display_bulk_actions() method.

WP_List_Table::get_bulk_actions() #

Retrieves the list of bulk actions available for this table.


Description

The format is an associative array where each element represents either a top level option value and label, or an array representing an optgroup and its options.

For a standard option, the array element key is the field value and the array element value is the field label.

For an optgroup, the array element key is the label and the array element value is an associative array of options as above.

Example:

[
    'edit'         => 'Edit',
    'delete'       => 'Delete',
    'Change State' => [
        'feature' => 'Featured',
        'sale'    => 'On Sale',
    ]
]

Top ↑

Return

(array)


Top ↑

More Information

Override this method to return an associative array ( action_slug => action_title ) containing all the bulk actions available for the table.


Top ↑

Source

File: wp-admin/includes/class-wp-list-table.php

	protected function get_bulk_actions() {
		return array();
	}


Top ↑

Changelog

Changelog
VersionDescription
5.6.0A bulk action can now contain an array of options in order to create an optgroup.
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.