The gform_print_entry_header action hook allows you to add a custom header to the print entry screen in Gravity Forms.
Usage
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { // your custom code here }
Parameters
$form
(Form Object): The current form.$entry
(Entry Object): The current entry object.
More information
See Gravity Forms Docs: gform_print_entry_header
This action hook is located in print-entry.php
.
Examples
Add a custom header with date and time
This example adds a custom header with the date and time of the entry to the Print Entry screen.
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { echo "<h2>Date and Time: " . $entry['date_created'] . "</h2>"; }
Add a custom header with form title
This example adds a custom header with the form title to the Print Entry screen.
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { echo "<h2>Form Title: " . $form['title'] . "</h2>"; }
Add a custom header with entry ID
This example adds a custom header with the entry ID to the Print Entry screen.
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { echo "<h2>Entry ID: " . $entry['id'] . "</h2>"; }
Add a custom header with user information
This example adds a custom header with the user’s display name and email to the Print Entry screen.
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { $user_info = get_userdata($entry['created_by']); echo "<h2>User: " . $user_info->display_name . " | Email: " . $user_info->user_email . "</h2>"; }
Add a custom header with a company logo
This example adds a custom header with a company logo to the Print Entry screen.
add_action('gform_print_entry_header', 'custom_header', 10, 2); function custom_header($form, $entry) { echo '<img src="https://yourwebsite.com/logo.png" alt="Company Logo" />'; }