gform_entries_column

Description

Use this action to inject markup to any non-first column of every entry in the entry list grid.

Usage

add_action( 'gform_entries_column', 'add_icon', 10, 5 );

Parameters

  • $form_id integer

    ID of the current form.

  • $field_id integer

    ID of the field that this column applies to.

  • $value string

    Current value that will be displayed in this cell.

  • $entry Entry Object

    Current entry object.

  • $query_string string

    Current page query string with search and pagination state.

Examples

This example appends an icon to the column depending on the text being displayed in the cell.

Note: This example assumes that field with ID 5 is NOT placed in the first column on the entry grid. This hook does not fire for the first column in the grid. Look at gform_entries_first_column to add content to the first column.

add_action( 'gform_entries_column', 'add_icon', 10, 5 );
function add_icon( $form_id, $field_id, $value, $entry, $query_string ) {

//targeting form 190 only.
if ( $form_id != 190 )
return;

//targeting field 5 only
if ( $field_id != 5 )
return;

if ( $value == 'yes' ) {
echo " <img src='" . GFCommon::get_base_url() . "/images/tick.png' />";
} elseif ( $value == 'no' ) {
echo " <img src='" . GFCommon::get_base_url() . "/images/stop.png' />";
}
}

Source Code

This action hook is located in GFEntryList::leads_page() in entry_list.php.