Description
Use this action hook to add extra action links to the entry row on the entry list page.
Usage
1 | add_action( 'gform_entries_first_column_actions' , 'first_column_actions' , 10, 5 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$form_id | integer | The ID of the form from which the entry value was submitted. |
$field_id | integer | The ID of the field from which the entry value was submitted. |
$value | string | The entry value of the field id for the current lead. |
$entry | Entry Object | The current entry. |
$query_string | string | The current page’s Query String in the format “name1=val1&name2=val2”. |
Examples
1. Print Entry Action
This example demonstrates how to add Gravity Form’s print entry functionality (currently available on the Entry Detail page) as an action link on the Entries list page.
1 2 3 4 5 6 7 8 9 10 11 | add_action( 'gform_entries_first_column_actions' , 'first_column_actions' , 10, 4 ); function first_column_actions( $form_id , $field_id , $value , $entry ) { $url = add_query_arg( array ( 'gf_page' => 'print-entry' , 'fid' => $form_id , 'lid' => $entry [ 'id' ], 'notes' => '1' , ), site_url() ); printf( '| <a onclick="var url = \'%s\'; window.open( url, \'printwindow\' )" href="javascript:;">Print</a>' , $url ); } |
2. Mark As Paid
1 2 3 | add_action( 'gform_entries_first_column_actions' , function ( $form_id , $field_id , $value , $entry ) { echo "| <span><a href=\"javascript:UpdateLeadProperty( {$entry['id']}, 'payment_status', 'Paid' );location.reload();\">Mark as Paid</a></span>" ; }, 10, 4 ); |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in GFEntryList::leads_page() in entry_list.php.