The gform_entry_detail_sidebar_before action hook allows you to add extra content (such as text or boxes) before the first box in the Entry detail sidebar of Gravity Forms.
Usage
add_action('gform_entry_detail_sidebar_before', 'add_sidebar_text_before', 10, 2);
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_before
Examples
Add a custom message before the sidebar
In this example, we add a custom message before the first box in the Entry detail sidebar.
add_action('gform_entry_detail_sidebar_before', 'add_custom_message', 10, 2); function add_custom_message($form, $entry) { echo "<div class='custom-message'>Welcome to the Entry Detail Sidebar!</div>"; }
Display the entry creation date
In this example, we display the entry creation date before the first box in the Entry detail sidebar.
add_action('gform_entry_detail_sidebar_before', 'display_entry_creation_date', 10, 2); function display_entry_creation_date($form, $entry) { $date_created = $entry['date_created']; echo "<div class='entry-date'>Entry created on: {$date_created}</div>"; }
Display the form title
In this example, we display the form title before the first box in the Entry detail sidebar.
add_action('gform_entry_detail_sidebar_before', 'display_form_title', 10, 2); function display_form_title($form, $entry) { $form_title = $form['title']; echo "<div class='form-title'>Form: {$form_title}</div>"; }
Display a custom field value
In this example, we display a custom field value (with field ID 5) from the entry before the first box in the Entry detail sidebar.
add_action('gform_entry_detail_sidebar_before', 'display_custom_field_value', 10, 2); function display_custom_field_value($form, $entry) { $field_value = $entry['5']; echo "<div class='custom-field-value'>Custom Field Value: {$field_value}</div>"; }
Add a link to the entry list page
In this example, we add a link to the entry list page before the first box in the Entry detail sidebar.
add_action('gform_entry_detail_sidebar_before', 'add_link_to_entry_list', 10, 2); function add_link_to_entry_list($form, $entry) { $form_id = $form['id']; $entry_list_url = admin_url("admin.php?page=gf_entries&id={$form_id}"); echo "<div class='entry-list-link'><a href='{$entry_list_url}'>Back to Entry List</a></div>"; }