gform_entry_detail_grid_display_empty_fields

Description

Allow displaying empty fields on the entry detail page/print view even if option is not checked.

Usage

add_filter( 'gform_entry_detail_grid_display_empty_fields', 'your_function_name' );

Parameters

  • $display_empty_fields bool

    Whether empty fields should be displayed.

  • $form Form Object

    The form object the entry currently being viewed belongs to.

  • $entry Entry Object

    The entry currently being viewed.

Example

1. Force display

add_filter( 'gform_entry_detail_grid_display_empty_fields', '__return_true' );

This example can be used to include empty fields in the entry printout.

add_filter( 'gform_entry_detail_grid_display_empty_fields', function ( $display_empty_fields ) {
if ( ! $display_empty_fields ) {
$display_empty_fields = rgget( 'gf_display_empty_fields', $_COOKIE );
}

return $display_empty_fields;
} );

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

$display_empty_fields = apply_filters( 'gform_entry_detail_grid_display_empty_fields', $display_empty_fields, $form, $lead );

This filter is located in GFEntryDetail::lead_detail_grid() in entry_detail.php.

Since

This filter was added in version 1.8.18.