Make WordPress Core


Ignore:
Timestamp:
10/18/2020 04:20:07 PM (6 years ago)
Author:
johnbillion
Message:

Administration: Allow WP_List_Table::get_bulk_items() to receive a nested array in order to output optgroups.

The allowed format for bulk actions is now 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.

Props goldenapples, mattkeys, valentinbora, davidbaumwald

Fixes #19278

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r49108 r49190  
    260260         * @since 3.1.0
    261261         *
    262          * @return string[] Array of bulk action labels keyed by their action.
     262         * @return array Array of bulk action labels keyed by their action.
    263263         */
    264264        protected function get_bulk_actions() {
Note: See TracChangeset for help on using the changeset viewer.