BP_Groups_List_Table::get_sortable_columns()
Get the column names for sortable columns.
Description Description
Note: It’s not documented in WP, but the second item in the nested arrays below is $desc_first. Normally, we would set last_active to be desc_first (since you’re generally interested in the most recently active group, not the least). But because the default sort for the Groups admin screen is DESC by last_active, we want the first click on the Last Active column header to switch the sort order – ie, to make it ASC. Thus last_active is set to $desc_first = false.
Return Return
(array) Array of sortable column names.
Source Source
File: bp-groups/classes/class-bp-groups-list-table.php
public function get_sortable_columns() {
/**
* Filters the column names for the sortable columns.
*
* @since 5.0.0
*
* @param array $value Array of keys and their values.
*/
return apply_filters( 'bp_groups_list_table_get_sortable_columns', array(
'gid' => array( 'gid', false ),
'comment' => array( 'name', false ),
'members' => array( 'members', false ),
'last_active' => array( 'last_active', false ),
) );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.7.0 | Introduced. |