gform_entry_list_columns

gform_entry_list_columns

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_entry_list_columns」 filter in Gravity Forms allows the columns set to be displayed on the Entry List page to be changed. This allows different columns to be displayed for each form.
Usage
The following would apply to all forms:
add_filter( 'gform_entry_list_columns', 'your_function_name', 10, 2 );

To target a specific form, append the form id to the hook name. (format: gform_entry_list_columns_FORMID)
add_filter( 'gform_entry_list_columns_1', 'your_function_name', 10, 2 );

Parameters

$table_columns array
The columns to be displayed in the entry list table.

$form_id integer
The ID of the form to which the entries being displayed belong.

Examples
This example adds the Address City column on the form to be displayed in the entry list.
add_filter( 'gform_entry_list_columns', 'set_columns', 10, 2 );
function set_columns( $table_columns, $form_id ){
$table_columns['field_id-3.3'] = 'City';
return $table_columns;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.0.7.6.
Source Code
This filter is located in GF_Entry_List_Table::get_columns() in entry_list.php.

发表回复

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