Using Gravity Forms ‘gform_display_field_select_columns_entry_list’ PHP filter

The gform_display_field_select_columns_entry_list filter allows you to add or remove fields from the select columns UI on the entry list.

Usage

To apply the filter to all forms:

add_filter('gform_display_field_select_columns_entry_list', 'your_function_name', 10, 3);

To target a specific form, append the form ID to the hook name:

add_filter('gform_display_field_select_columns_entry_list_1', 'your_function_name', 10, 3);

To target a specific form’s field, append the form ID and field ID to the hook name:

add_filter('gform_display_field_select_columns_entry_list_1_1', 'your_function_name', 10, 3);

Parameters

  • $display (bool): Indicates whether the field will be available for selection.
  • $field (Field Object): The current field.
  • $form (Form Object): The current form.

More information

See Gravity Forms Docs: gform_display_field_select_columns_entry_list

Examples

Show field with ID 4, hide all others

This example shows the field with ID 4 and hides all other fields from the select columns UI.

add_filter('gform_display_field_select_columns_entry_list', 'show_hide_fields', 10, 3);

function show_hide_fields($display, $field, $form){
    if ($field['id'] == 4){
        return true;
    }
    return false;
}

Show fields with IDs 2, 4, and 6

This example shows fields with IDs 2, 4, and 6, and hides all other fields from the select columns UI.

add_filter('gform_display_field_select_columns_entry_list', 'show_selected_fields', 10, 3);

function show_selected_fields($display, $field, $form){
    $allowed_fields = array(2, 4, 6);
    return in_array($field['id'], $allowed_fields);
}

Show fields only if they have a specific type

This example shows fields of type ‘text’, and hides all other fields from the select columns UI.

add_filter('gform_display_field_select_columns_entry_list', 'show_text_fields', 10, 3);

function show_text_fields($display, $field, $form){
    return $field['type'] == 'text';
}

Hide fields for a specific form

This example hides all fields from the select columns UI for the form with ID 2.

add_filter('gform_display_field_select_columns_entry_list_2', 'hide_all_fields', 10, 3);

function hide_all_fields($display, $field, $form){
    return false;
}

Show only a specific field for a specific form

This example shows field with ID 4 for form with ID 1, and hides all other fields from the select columns UI for that form.

add_filter('gform_display_field_select_columns_entry_list_1', 'show_field_for_form', 10, 3);

function show_field_for_form($display, $field, $form){
    return $field['id'] == 4;
}