gform_entry_detail_sidebar_middle

Description

The gform_entry_detail_sidebar_middle action allows developers to add extra content to the sidebar. In Gravity Forms 1.9 and earlier, the content would be displayed before the Notifications box (if visible). In Gravity Forms 2.0+, the content is displayed after the meta boxes but before the print button.

Note: To add custom meta boxes to the sidebar, we recommend using the gform_entry_detail_meta_boxes filter.

Usage

add_action( 'gform_entry_detail_sidebar_middle', 'add_sidebar_text_middle', 10, 2 );

Parameters

ParameterTypeDescription
$formForm ObjectThe form from which the entry value was submitted.
$entryEntry ObjectThe current entry.

Examples

Add a box to the sidebar.

This example adds a new box with a header and text.

add_action( 'gform_entry_detail_sidebar_middle', 'add_sidebar_text_middle', 10, 2 );
function add_sidebar_text_middle( $form, $entry ) {
	echo "<div class='stuffbox'><h3><span class='hndle'>Stuff in the Middle</span></h3><div class='inside'>text added in the middle!<br/></div></div>";
}

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 action is located in GFEntryDetail::lead_detail_page() in entry_detail.php.