Description
Runs when entries are being displayed and allows a custom display to be used for the entry.
Usage
add_action( 'gform_print_entry_content', 'my_function', 10, 3 );
Parameters
- $form Form ObjectThe current form.
- $entry Entry Object
The current entry.
- $entry_ids array
The IDs of the entries being displayed.
Examples
Example 1
add_action( 'gform_print_entry_content', 'gform_default_entry_content', 10, 3 );
function gform_default_entry_content( $form, $entry, $entry_ids ) {
$page_break = rgget( 'page_break' ) ? 'print-page-break' : false;
// Separate each entry inside a form element so radio buttons don't get treated as a single group across multiple entries.
echo '<form>';
GFEntryDetail::lead_detail_grid( $form, $entry );
echo '</form>';
if ( rgget( 'notes' ) ) {
$notes = GFFormsModel::get_lead_notes( $entry['id'] );
if ( ! empty( $notes ) ) {
GFEntryDetail::notes_grid( $notes, false );
}
}
// Output entry divider/page break.
if ( array_search( $entry['id'], $entry_ids ) < count( $entry_ids ) - 1 ) {
echo '<div class="print-hr ' . $page_break . '"></div>';
}
}
Example 2
// Prevent the default content being output.
add_action( 'gform_print_entry_content', function() {
remove_action( 'gform_print_entry_content', 'gform_default_entry_content', 10 );
}, 1 );
// Bind our custom entry content function.
add_action( 'gform_print_entry_content', 'my_print_entry_content', 10, 3 );
function my_print_entry_content( $form, $entry, $entry_ids ) {
GFEntryDetail::lead_detail_grid( $form, $entry );
}
Placement
This code should be placed in the functions.php file of your active theme.
Since
The filter was added in Gravity Forms version 1.9.14.16.
Source Code
This action hook is located in print-entry.php.