BP_Groups_List_Table::get_sortable_columns()

Get the column names for sortable columns.

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

(array) Array of sortable column names.

Source

File: bp-groups/classes/class-bp-groups-list-table.php

	public function get_sortable_columns() {
		return array(
			'gid'         => array( 'gid', false ),
			'comment'     => array( 'name', false ),
			'members'     => array( 'members', false ),
			'last_active' => array( 'last_active', false ),
		);
	}

Changelog

Changelog
Version Description
BuddyPress 1.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.