WP_List_Table::get_sortable_columns()protectedWP 3.1.0

Gets a list of sortable columns.

The format is:

  • 'internal-name' => 'orderby'
  • 'internal-name' => array('orderby', bool,'abbr','orderby-text','initially-sorted-column-order') -
  • 'internal-name' => array('orderby','asc') - The second element sets the initial sorting order.
  • 'internal-name' => array('orderby', true ) - The second element makes the initial order descending.

In the second format, passing true as second parameter will make the initial sorting order be descending. Following parameters add a short column name to be used as 'abbr' attribute, a translatable string for the current sorting, and the initial order for the initial sorted column, 'asc' or 'desc' (default: false).

Метод класса: WP_List_Table{}

Хуков нет.

Возвращает

Массив.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_sortable_columns();

Список изменений

С версии 3.1.0 Введена.
С версии 6.3.0 Added 'abbr', 'orderby-text' and 'initially-sorted-column-order'.

Код WP_List_Table::get_sortable_columns() WP 6.4.3

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