gravityflow_sort_columns_status_table

Description

The gravityflow_sort_columns_status_table filter allows custom columns defined in gravityflow_field_value_status_table to be sorted.

Parameters

ParameterTypeDetails
$sortableArrayThe set of columns which are sortable for status page.

Examples

Define a custom column to be sortable

A custom meta column, defined through gform_entry_meta, would also use gravityflow_columns_status_table to display the custom column,  gravityflow_field_value_status_table to display the custom meta value in the column. Possibly also with gravityflow_sort_criteria_status to define a default sort behaviour.

1
2
3
4
5
6
7
add_filter( 'gravityflow_sort_columns_status_table', 'custom_sort_columns', 10, 1 );
function custom_sort_columns( $sortable ) {
    //The array key must match a gravityflow_field_value_status_table filtered entry
    //The array value must match an entry meta or field ID
    $sortable['priority'] = array( 'priority', true );
    return $sortable;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?