gform_print_entry_content

gform_print_entry_content

DescriptionUsageParametersExamplesExample 1Example 2PlacementSinceSource Code

Description

Runs when entries are being displayed and allows a custom display to be used for the entry.

Usage

1add_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

12345678910111213141516171819202122232425add_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 '

';  GFEntryDetail::lead_detail_grid( $form, $entry );  echo '

';  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 '

';}  }

Example 2

12345678910// 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.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注