Filter
rpress_payments_table_sortable_columns
On this page
Filters the sortable columns of the Orders list table.
The default sortable columns are ID and amount. Each value is an array of the orderby key and whether the first click sorts descending, as expected by WP_List_Table.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$columns | array | Associative array of column key to array( orderby, desc_first ). |
Return value#
array. The sortable columns array.
Example#
function my_orders_sortable_columns( $columns ) {
$columns['my_source'] = array( 'my_source', false );
return $columns;
}
add_filter( 'rpress_payments_table_sortable_columns', 'my_orders_sortable_columns' );
Notes#
Adding a column here only renders the sort link; the query must handle the orderby value for the sort to work.
Source#
Applied in:
includes/admin/payments/class-payments-table.php(line 1436), inRPRESS_Payment_History_Table::get_sortable_columns()
See also#
Was this page helpful?
