gform_filters_pre_results

gform_filters_pre_results

DescriptionUsageParametersExamplesPlacementSource Code

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
1add_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.
123456789add_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
1apply_filters( 'gform_filters_pre_results', $filter_settings, $form );
This filter is located in GFResults::results_page() in includes/addon/class-gf-results.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注