Using Gravity Forms ‘gform_entries_column’ PHP action

The gform_entries_column action in Gravity Forms allows you to inject custom markup into 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.

More information

See Gravity Forms Docs: gform_entries_column

Examples

Append an icon to the column depending on the text being displayed in the cell

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.