Trouble with the entries column filter [RESOLVED]

Hi All
I have tried to add the “Print Entry Action” from this page:

But my code editor find a syntax error:
syntax error, unexpected ‘var’ (T_VAR), expecting ‘,’ or ‘;’

Also I guess that the url to be changed as well get it to work?

There was a typo in the code snippet which has now been corrected.

1 Like

Hi Richard
Thank you for your reply. I feel total noob. The code on:

Still makes the error but I changed it to:

add_action( 'gform_entries_first_column_actions', 'first_column_actions', 10, 4 );
function first_column_actions( $form_id, $field_id, $value, $entry ) {
$lead_id = $entry['id'];
echo "| <a href=\"javascript:;\" onclick=\"var url='https://docs.gravityforms.com/wp-content/plugins/gravityforms/print-entry.php?fid={$form_id}&lid={$lead_id}&notes=1'; window.open (url,'printwindow');\">Print</a>";
}
  1. The column does not show on the page [domain]/wp-admin/admin.php?page=gf_entries&id=8
  2. Should there be a difference on last parameter – see “usage” it is 5 and under “1. Print Entry Action” it is 4?
    (3. Also there is an error in the console “Unchecked runtime.lastError: The message port closed before a response was received. admin.php?page=gf_entries&id=8:1” ) not related it was a error regarding an extension in chrome ( Google Publisher Toolbar)

Sorry about that I didn’t spot the quotes. I’ve updated the snippet again.

This hook only runs for form field columns, so if you have an entry property as the first column in the table then the hook will skip that column and only run for the first column to output a field value.

Thank you for the update. It does not appear :frowning: but I found an other way:

In the menu there is a print option…

Found it and it works! The print link will only appear under the entry when the entry is hovered… In my mind I thought it would be a completely new column.

Glad you found that. It’s the Print option in the “Bulk Actions” dropdown on the page that lists your entries.

chrome_2019-02-28_06-29-05

This is a good example of just asking what you would like to accomplish rather skipping ahead to just tell us where you get stuck :slight_smile: Letting us know what you have tried is also important, but if the question had been “How do I print a bunch of entries at one time” we might have pointed you right to it.