The gform_entry_detail_sidebar_middle action hook allows you to add extra content to the sidebar in the Gravity Forms entry details page.
Usage
add_action('gform_entry_detail_sidebar_middle', 'add_sidebar_text_middle', 10, 2); function add_sidebar_text_middle($form, $entry) { // your custom code here return $form; }
Parameters
- $form (Form Object): The form from which the entry value was submitted.
- $entry (Entry Object): The current entry.
More information
See Gravity Forms Docs: gform_entry_detail_sidebar_middle
Examples
Add a custom box with a title and text
This example adds a custom box with a title and text to the sidebar.
add_action('gform_entry_detail_sidebar_middle', 'add_sidebar_text_middle', 10, 2); function add_sidebar_text_middle($form, $entry) { echo "<div class='custom-box'><h3><span>Custom Title</span></h3><div>Custom text added to the sidebar.</div></div>"; }
Display entry creation date
This example displays the entry creation date in the sidebar.
add_action('gform_entry_detail_sidebar_middle', 'display_entry_creation_date', 10, 2); function display_entry_creation_date($form, $entry) { echo "<div class='entry-date'><strong>Entry Date:</strong> {$entry['date_created']}</div>"; }
Show the IP address of the user who submitted the form
This example shows the IP address of the user who submitted the form in the sidebar.
add_action('gform_entry_detail_sidebar_middle', 'display_entry_ip', 10, 2); function display_entry_ip($form, $entry) { echo "<div class='entry-ip'><strong>IP Address:</strong> {$entry['ip']}</div>"; }
Display entry status
This example displays the current entry status (e.g., “active” or “spam”) in the sidebar.
add_action('gform_entry_detail_sidebar_middle', 'display_entry_status', 10, 2); function display_entry_status($form, $entry) { echo "<div class='entry-status'><strong>Entry Status:</strong> {$entry['status']}</div>"; }
Show the user agent of the user who submitted the form
This example shows the user agent of the user who submitted the form in the sidebar.
add_action('gform_entry_detail_sidebar_middle', 'display_entry_user_agent', 10, 2); function display_entry_user_agent($form, $entry) { echo "<div class='entry-user-agent'><strong>User Agent:</strong> {$entry['user_agent']}</div>"; }