Description
Use this filter to modify the filters used in the drop down list of fields in the admin results page. The results page is currently only used by add-ons that implement the Add-On Framework.
Usage
add_filter( 'gform_filters_pre_results', 'your_function_name', 10, 2 );
Parameters
- $filter_settings array
The array of filters.
-
$form Form Object
The form object.
Examples
This example removes payment related info fields from the filters.
add_filter( 'gform_filters_pre_results', 'remove_payment_filters', 10, 2 ); function remove_payment_filters( $filter_settings, $form ) { foreach ( $filters as $i => $filter ) { if ( in_array( $filter_settings['key'], array( 'payment_amount', 'payment_date', 'payment_status', 'transaction_id' ) ) ) { unset( $filter_settings[ $i ] ); } } return $filter_settings; }
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
apply_filters( 'gform_filters_pre_results', $filter_settings, $form );
This filter is located in GFResults::results_page() in includes/addon/class-gf-results.php.