gform_entry_list_columns

gform_entry_list_columns

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_entry_list_columns」 filter in Gravity Forms allows the columns set to be displayed on the Entry List page to be changed. This allows different columns to be displayed for each form.
Usage
The following would apply to all forms:
add_filter( 'gform_entry_list_columns', 'your_function_name', 10, 2 );

To target a specific form, append the form id to the hook name. (format: gform_entry_list_columns_FORMID)
add_filter( 'gform_entry_list_columns_1', 'your_function_name', 10, 2 );

Parameters

$table_columns array
The columns to be displayed in the entry list table.

$form_id integer
The ID of the form to which the entries being displayed belong.

Examples
This example adds the Address City column on the form to be displayed in the entry list.
add_filter( 'gform_entry_list_columns', 'set_columns', 10, 2 );
function set_columns( $table_columns, $form_id ){
$table_columns['field_id-3.3'] = 'City';
return $table_columns;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.0.7.6.
Source Code
This filter is located in GF_Entry_List_Table::get_columns() in entry_list.php.

gform_entry_list_column_input_label_only

gform_entry_list_column_input_label_only

DescriptionUsageParametersExamplesInclude Product Field LabelPlacementSource CodeSince

Description
This filter can be used to override the default behavior of only including the input label in the entry list column header.
Usage
The base filter which would run for all forms and all fields would be used like so:
add_filter( 'gform_entry_list_column_input_label_only', 'your_function_name', 10, 3 );

Parameters

$input_label_only bool
Should the label only include the input label.

$form Form Object
The form currently being processed.

$field Field Object
The field currently being processed.

Examples
Include Product Field Label
This example shows how you can also include the field label along with the choice label.
add_filter( 'gform_entry_list_column_input_label_only', function ( $input_label_only, $form, $field ) {
return $field->type == 'product' ? false : $input_label_only;
}, 10, 3 );

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
$input_label_only = apply_filters( 'gform_entry_list_column_input_label_only', $input_label_only, $form, $field );

This filter is located in GFFormsModel::get_grid_columns() in forms_model.php.
Since
This filter was added in Gravity Forms 1.9.3.

gform_entry_list_bulk_actions

gform_entry_list_bulk_actions

DescriptionUsageParametersExample(s)PlacementSinceSource Code

Description
The 「gform_entry_list_bulk_actions」 filter in Gravity Forms allows the drop down of available bulk actions on the entries list to be modified. This filter works well with the gform_entry_list_action action for handling the custom actions added.
Usage
The following would apply to all forms:
1add_filter( 'gform_entry_list_bulk_actions', 'your_function_name', 10, 2 );
To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format:gform_entry_list_bulk_actions_FORMID)
1add_filter( 'gform_entry_list_bulk_actions_21', 'your_function_name', 10, 2 );

Parameters

$actions array
An array of the bulk actions to be used in the drop down list.

$form_id int
The ID of the current form.

Example(s)
12345add_filter( 'gform_entry_list_bulk_actions_21', 'add_actions', 10, 2 );function add_actions( $actions, $form_id ){    $actions['my_custom_action'] = 'My Custom Action';    return $actions;}
Placement
Your code snippet should be placed in the functions.php file of your active theme.
Since
Gravity Forms Version 2.2.4.
Source Code
This filter is located in the GF_Entry_List_Table::get_bulk_actions() in gravityforms/entry_list.php.

gform_entry_is_spam

gform_entry_is_spam

DescriptionUsageParametersExamplesBasic UsageIntegrate with OOPSpam Anti-SpamIntegrate with PlinoIntegrate with ZeroBounceCheck field values for URLsIP Rate LimitCheck Name Field ValuesIntegrate with ipapi.coIntegrate with iplocate.ioMark as Not Spam for administratorsIntegrate with Komprehend Abusive Content ClassifierIntegrate with PurgoMalum profanity filterIntegrate with Moderation APIIntegrate with Detect Language APIPlacementSource Code

Description

The gform_entry_is_spam filter is used to mark entries as spam during form submission.

Notifications and add-on feeds will NOT be processed for submissions which are marked as spam.

As the submission completes the default 「Thanks for contacting us! We will get in touch with you shortly.」 message will be displayed instead of the forms configured confirmation. The gform_confirmation filter can be used to change the message.

Usage

The following would apply to all forms.

add_filter( 'gform_entry_is_spam', 'your_function_name', 10, 3 );

To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_entry_is_spam_FORMID)

add_filter( 'gform_entry_is_spam_6', 'your_function_name' );

Parameters

$is_spam bool
Indicates if the entry is to be marked as spam.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry being evaluated.

Examples

Basic Usage

add_filter( 'gform_entry_is_spam', 'it_is_all_spam', 10, 3 );
function it_is_all_spam( $is_spam, $form, $entry ) {
return true;
}

Integrate with OOPSpam Anti-Spam

This example shows how a field value can be checked by the OOPSpam Anti-Spam plugin.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_oopspam', 11, 3 );
function filter_gform_entry_is_spam_oopspam( $is_spam, $form, $entry ) {
if ( $is_spam || ! function_exists( 'oopspamantispam_call_OOPSpam' ) ) {
return $is_spam;
}

$field_id = '1'; // The ID of the field containing the value to be checked.
$message = rgar( $entry, $field_id );
$ip = rgars( $form, 'personalData/preventIP' ) ? GFFormsModel::get_ip() : rgar( $entry, 'ip' );
$is_spam = ! oopspamantispam_call_OOPSpam( $message, $ip );
GFCommon::log_debug( __METHOD__ . '(): ' . json_encode( $is_spam ) );

return $is_spam;
}

Integrate with Plino

This example shows how a field value can be checked by the Plino spam filtering system.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_plino', 11, 3 );
function filter_gform_entry_is_spam_plino( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_id = '1'; // The ID of the field containing the value to be checked.
$text = rgar( $entry, $field_id );

$args = array(
'headers' => array(
'Content-Type' => 'application/json',
),
'body' => json_encode( array(
'email_text' => $text,
) ),
);

$response = wp_remote_post( 'https://plino.herokuapp.com/api/v1/classify/', $args );

if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) === 200 ) {
$response_body = wp_remote_retrieve_body( $response );
GFCommon::log_debug( __METHOD__ . '(): ' . print_r( $response_body, true ) );

return rgar( json_decode( $response_body, true ), 'email_class' ) === 'spam';
}

return false;
}

Integrate with ZeroBounce

This example shows how a field value can be checked by the ZeroBounce Email Validation API.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_zerobounce', 11, 3 );
function filter_gform_entry_is_spam_zerobounce( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_id = '1'; // The ID of the field containing the email address to be checked.
$email = rgar( $entry, $field_id );

if ( GFCommon::is_invalid_or_empty_email( $email ) ) {
return true;
}

$ip = rgars( $form, 'personalData/preventIP' ) ? GFFormsModel::get_ip() : rgar( $entry, 'ip' );

$request_url = add_query_arg(
array(
'email' => $email,
'ip_address' => $ip,
'api_key' => 'your_api_key_here',
),
'https://api.zerobounce.net/v2/validate'
);

$response = wp_remote_get( $request_url );

if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) === 200 ) {
$response_body = wp_remote_retrieve_body( $response );
GFCommon::log_debug( __METHOD__ . '(): ' . print_r( $response_body, true ) );

return rgar( json_decode( $response_body, true ), 'status' ) !== 'valid';
}

return false;
}

Check field values for URLs

This example shows how you can mark a submission as spam if a field value contains a URL. It checks only fields of the following types: Hidden, Single Line Text, Paragraph.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_urls', 11, 3 );
function filter_gform_entry_is_spam_urls( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_types_to_check = array(
'hidden',
'text',
'textarea',
);

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || ! in_array( $field->get_input_type(), $field_types_to_check ) ) {
continue;
}

// Skipping fields which don't have a value.
$value = $field->get_value_export( $entry );
if ( empty( $value ) ) {
continue;
}

// If value contains a URL mark submission as spam.
if ( preg_match( '~(https?|ftp)://S+~', $value ) ) {
return true;
}
}

return false;
}

IP Rate Limit

This example shows how you can mark a submission as spam if the IP address is the source of multiple submissions.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_ip_rate_limit', 11, 3 );
function filter_gform_entry_is_spam_ip_rate_limit( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$ip_address = empty( $entry['ip'] ) ? GFFormsModel::get_ip() : $entry['ip'];

if ( ! filter_var( $ip_address, FILTER_VALIDATE_IP ) ) {
return true;
}

$key = wp_hash( __FUNCTION__ . $ip_address );
$count = (int) get_transient( $key );

if ( $count >= 2 ) {
return true;
}

$count ++;
set_transient( $key, $count, HOUR_IN_SECONDS );

return false;
}

Check Name Field Values

This example shows how you can mark a submission as spam if the first and last name inputs contain the same value.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_name_values', 11, 3 );
function filter_gform_entry_is_spam_name_values( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || $field->get_input_type() !== 'name' || $field->nameFormat === 'simple' ) {
continue;
}

$first_name = rgar( $entry, $field->id . '.3' );
$last_name = rgar( $entry, $field->id . '.6' );

if ( ! empty( $first_name ) && ! empty( $last_name ) && $first_name === $last_name ) {
return true;
}
}

return false;
}

Integrate with ipapi.co

This example shows how the ipapi.co service can be used to get the country code for the IP address of the form submitter enabling you to mark submissions as spam if they originate from specified countries.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_ipapi_country', 11, 3 );
function filter_gform_entry_is_spam_ipapi_country( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$ip_address = empty( $entry['ip'] ) ? GFFormsModel::get_ip() : $entry['ip'];
if ( ! filter_var( $ip_address, FILTER_VALIDATE_IP ) ) {
return true;
}

$response = wp_remote_get( sprintf( 'https://ipapi.co/%s/country/', $ip_address ) );
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
return false;
}

$response_country_code = trim( wp_remote_retrieve_body( $response ) );
if ( empty( $response_country_code ) ) {
return false;
}

// The two letter ISO 3166-1 alpha-2 country codes.
$country_codes = array( 'CN', 'RU' );

return in_array( $response_country_code, $country_codes );
}

Integrate with iplocate.io

This example shows how the iplocate.io service can be used to get the country code for the IP address of the form submitter enabling you to mark submissions as spam if they originate from specified countries.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_iplocate_country', 11, 3 );
function filter_gform_entry_is_spam_iplocate_country( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$ip_address = empty( $entry['ip'] ) ? GFFormsModel::get_ip() : $entry['ip'];
if ( ! filter_var( $ip_address, FILTER_VALIDATE_IP ) ) {
return true;
}

$response = wp_remote_get( 'https://www.iplocate.io/api/lookup/' . $ip_address );
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
return false;
}

$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
if ( empty( $response_body['country_code'] ) ) {
return false;
}

// The two letter ISO 3166-1 alpha-2 country codes.
$country_codes = array( 'CN', 'RU' );

return in_array( $response_body['country_code'], $country_codes );
}

Mark as Not Spam for administrators

This example shows how prevent entries being marked as spam for logged in users with the 『administrator』 role.

add_filter( 'gform_entry_is_spam', 'gf_admin_is_not_spam', 10, 3 );
function gf_admin_is_not_spam( $is_spam, $form, $entry ) {
if ( $is_spam && current_user_can( 'administrator' ) ) {
// Always not spam for users with administrator role.
$is_spam = false;
GFCommon::log_debug( __METHOD__ . '(): Entry marked as not spam for administrator role.' );
}

return $is_spam;
}

Integrate with Komprehend Abusive Content Classifier

This example shows how you can use the Komprehend Abusive Content Classifier (ParallelDots Abuse API) to mark submissions as spam if Text or Paragraph field values are abusive or offensive.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_komprehend', 11, 3 );
function filter_gform_entry_is_spam_komprehend( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_types_to_check = array(
'text',
'textarea',
);

$text_to_check = array();

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || ! in_array( $field->get_input_type(), $field_types_to_check ) ) {
continue;
}

// Skipping fields which don't have a value.
$value = $field->get_value_export( $entry );
if ( empty( $value ) ) {
continue;
}

$text_to_check[] = $value;
}

if ( empty( $text_to_check ) ) {
return false;
}

$response = wp_remote_post( 'https://apis.paralleldots.com/v4/abuse_batch', array(
'body' => array(
'text' => json_encode( $text_to_check ),
'api_key' => 'your_api_key_here',
),
) );

if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
GFCommon::log_debug( __METHOD__ . '(): $response => ' . print_r( $response, true ) );

return false;
}

$results = rgar( json_decode( wp_remote_retrieve_body( $response ), true ), 'abuse' );

if ( empty( $results ) || ! is_array( $results ) ) {
GFCommon::log_debug( __METHOD__ . '(): $response => ' . print_r( $response, true ) );

return false;
}

// Add the checked text to the results.
foreach ( $text_to_check as $key => $text ) {
if ( ! isset( $results[ $key ] ) ) {
continue;
}
$results[ $key ]['text'] = $text;
}

// Define the thresholds the scores will be compared with.
$abuse_threshold = 0.75;
$hate_threshold = 0.75;

foreach ( $results as $result ) {
// Mark entry as spam if scores are equal to or greater than the thresholds.
if ( rgar( $result, 'abusive', 0 ) >= $abuse_threshold || rgar( $result, 'hate_speech', 0 ) >= $hate_threshold ) {
GFCommon::log_debug( __METHOD__ . '(): $results => ' . print_r( $results, true ) );

return true;
}
}

return false;
}

Integrate with PurgoMalum profanity filter

This example shows how you can use the PurgoMalum profanity filter to mark submissions as spam if Text or Paragraph field values contain words found on the PurgoMalum profanity list.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_purgomalum', 11, 3 );
function filter_gform_entry_is_spam_purgomalum( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_types_to_check = array(
'text',
'textarea',
);

$text_to_check = array();

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || ! in_array( $field->get_input_type(), $field_types_to_check ) ) {
continue;
}

// Skipping fields which don't have a value.
$value = $field->get_value_export( $entry );
if ( empty( $value ) ) {
continue;
}

$text_to_check[] = $value;
}

if ( empty( $text_to_check ) ) {
return false;
}

$args = array(
'text' => urlencode( implode( "rn", $text_to_check ) ),
);

$response = wp_remote_get( add_query_arg( $args, 'https://www.purgomalum.com/service/containsprofanity' ) );

if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
GFCommon::log_debug( __METHOD__ . '(): $response => ' . print_r( $response, true ) );

return false;
}

return wp_remote_retrieve_body( $response ) === 'true';
}

Integrate with Moderation API

This example shows how you can use the Moderation API Toxicity Analyzer to mark submissions as spam if Text or Paragraph field values contain profanity, swearing, racism, threats etc.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_moderationapi', 11, 3 );
function filter_gform_entry_is_spam_moderationapi( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_types_to_check = array(
'text',
'textarea',
);

$text_to_check = array();

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || ! in_array( $field->get_input_type(), $field_types_to_check ) ) {
continue;
}

// Skipping fields which don't have a value.
$value = $field->get_value_export( $entry );
if ( empty( $value ) ) {
continue;
}

$text_to_check[] = $value;
}

if ( empty( $text_to_check ) ) {
return false;
}

$response = wp_remote_post( 'https://moderationapi.com/api/v1/moderation/text', array(
'headers' => array(
'Authorization' => 'Bearer your_api_key_here',
'Content-Type' => 'application/json',
),
'body' => json_encode( array( 'value' => implode( "rn", $text_to_check ) ) ),
) );

if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
GFCommon::log_debug( __METHOD__ . '(): $response => ' . print_r( $response, true ) );

return false;
}

$body = json_decode( wp_remote_retrieve_body( $response ), true );
GFCommon::log_debug( __METHOD__ . '(): $body => ' . print_r( $body, true ) );

if ( empty( $body['toxicity'] ) || rgar( $body['toxicity'], 'label' ) === 'NEUTRAL' || empty( $body['toxicity']['label_scores'] ) ) {
return false;
}

// Define the thresholds the scores will be compared with; range from 0 (not spam) to 1 (definitely spam).
$thresholds = array(
'TOXICITY' => 0.75,
'PROFANITY' => 0.75,
'DISCRIMINATION' => 0.75,
);

foreach ( $thresholds as $key => $threshold ) {
// Mark entry as spam if score is equal to or greater than the threshold.
if ( rgar( $body['toxicity']['label_scores'], $key ) >= $threshold ) {
return true;
}
}

return false;
}

Integrate with Detect Language API

This example shows how you can use the Detect Language API to mark submissions as spam if Text or Paragraph field values aren』t the specified language, in this case English.

add_filter( 'gform_entry_is_spam', 'filter_gform_entry_is_spam_detectlanguage', 11, 3 );
function filter_gform_entry_is_spam_detectlanguage( $is_spam, $form, $entry ) {
if ( $is_spam ) {
return $is_spam;
}

$field_types_to_check = array(
'text',
'textarea',
);

$text_to_check = array();

foreach ( $form['fields'] as $field ) {
// Skipping fields which are administrative or the wrong type.
if ( $field->is_administrative() || ! in_array( $field->get_input_type(), $field_types_to_check ) ) {
continue;
}

// Skipping fields which don't have a value.
$value = $field->get_value_export( $entry );
if ( empty( $value ) ) {
continue;
}

$text_to_check[] = $value;
}

if ( empty( $text_to_check ) ) {
return false;
}

$response = wp_remote_post( 'https://ws.detectlanguage.com/0.2/detect', array(
'headers' => array(
'Authorization' => 'Bearer your_api_key_here',
'Content-Type' => 'application/json',
),
'body' => json_encode( array( 'q' => $text_to_check ) ),
) );

if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
GFCommon::log_debug( __METHOD__ . '(): $response => ' . print_r( $response, true ) );

return false;
}

$body = json_decode( wp_remote_retrieve_body( $response ), true );
GFCommon::log_debug( __METHOD__ . '(): $body => ' . print_r( $body, true ) );

if ( empty( $body['data'] ) || empty( $body['data']['detections'] ) || ! is_array( $body['data']['detections'] ) ) {
return false;
}

foreach ( $body['data']['detections'] as $detections ) {
foreach ( $detections as $detection ) {
// Not spam if language is English.
if ( rgar( $detection, 'language' ) === 'en' && rgar( $detection, 'isReliable' ) ) {
return false;
}
}
}

return true;
}

Placement

This code should be placed in the functions.php file of your active theme or a custom functions plugin.

Source Code

As of Gravity Forms 2.4.17 this filter is located in GFCommon::is_spam_entry() in common.php. It was previously located in GFFormDisplay::handle_submission() in form_display.php.

gform_entry_info

gform_entry_info

DescriptionUsageParametersExamplesSource Code

Description
Use this hook to add custom entry information to the Info area on the Entry detail page.
Usage
add_action( 'gform_entry_info', 'my_entry_info', 10, 2 );

Parameters

$form_id string
The ID of the form from which the entry was submitted.

$entry Entry Object
The current entry.

Examples
This very basic example will output 「Hello」 in the Info panel on the Entry Detail view.
add_action( 'gform_entry_info', 'my_entry_info', 10, 2 );
function my_entry_info( $form_id, $entry ) {
echo 'Hello';
}

Source Code
This filter is located in GFEntryDetail::lead_detail_page() in entry_detail.php.

gform_entry_ids_automatic_deletion

gform_entry_ids_automatic_deletion

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows the array of entry IDs to be modified before automatically deleting entries according to the personal data retention policy.
Usage
add_filter( 'gform_entry_ids_automatic_deletion', 'your_function_name', 10, 1 );

Parameters

$entry_ids array
The array of entry IDs to delete.

Examples
add_filter( 'gform_entry_ids_automatic_deletion', 'save_entries', 10, 1 );
function save_entries( $entry_ids ){
$delete_ids = array();
foreach ( $entry_ids as $entry_id )
{
$entry = GFFormsModel::get_entry( $entry_id );
//save entries for form id 74 that are not in the trash
if ( ! $entry['form_id'] == 74 || $entry['status'] == 'trash' ){
$delete_ids[] = $entry_id;
GFCommon::log_debug( 'Deleting entry ' . $entry['id'] );
}
else{
GFCommon::log_debug( 'Not deleting entry ' . $entry['id'] );
}
}
return $delete_ids;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.4.
Source Code
This filter is located in GF_Personal_Data::cron_task() in includes/class-personal-data.php.

gform_entry_id_pre_save_lead

gform_entry_id_pre_save_lead

DescriptionUsageParametersExamplesSource Code

Description
Allows entry id to be changed before submission is saved. Useful to update an existing entry instead of creating a new one.
Usage
Apply to all forms.
add_filter( 'gform_entry_id_pre_save_lead', 'my_update_entry_on_form_submission', 10, 2 );

Apply to a specific form.
add_filter( 'gform_entry_id_pre_save_lead_10', 'my_update_entry_on_form_submission', 10, 2 );

Parameters

$entry_id integer
Default value is null.

$form Form Object
The current form.

Examples
This example demonstrates how to use to this hook to retrieve an entry ID from the $_POST data and return it here so the existing entry is updated rather than a new entry created.
This assumes that the entry ID to be updated has been submitted with the form from an input which as the input name 「my_update_entry_id」. You can store it in any input, but you will need to update the input name used when you retrieve the value via the rgpost() function.
add_filter( 'gform_entry_id_pre_save_lead', 'my_update_entry_on_form_submission', 10, 2 );
function my_update_entry_on_form_submission( $entry_id, $form ) {
$update_entry_id = rgpost( 'my_update_entry_id' );
return $update_entry_id ? $update_entry_id : $entry_id;
}

Source Code
This filter is located in GFFormDisplay::handle_submission() in form_display.php.

gform_entry_field_value

gform_entry_field_value

DescriptionUsageParametersExamples1. Display category name2. Display choice label3. File UploadsAdditional NotesPlacementSource Code

Description
Use this filter to change the field』s value before getting displayed on the Entry detail page. Useful when creating custom field types that require special formatting when displayed,
Usage
add_filter( 'gform_entry_field_value', 'category_names', 10, 4 );

Parameters

$value string
The current entry value to be filtered.

$field Field Object
The field from which the entry value was submitted.

$entry Entry Object
The current entry.

$form Form Object
The form from which the entry value was submitted.

Examples
1. Display category name
This example assumes the original value is a comma delimited list of category IDs (i.e. 『1,3,4』). We then break the IDs into an array, loop through each ID to get the category name, and format the category name into an unordered list.
add_filter( 'gform_entry_field_value', 'category_names', 10, 4 );
function category_names( $value, $field, $lead, $form ) {

if ( $form['id'] != 104 || $field->id != 3 )
return $value;

$newvalue = *;
$categories = explode( ',', $value );

foreach ( $categories as $category ) {
$new_value .= '

  • ' . get_cat_name( $category ) . '
  • ';
    }

    return '

      ' . $new_value . '

    ';
    }

    2. Display choice label
    This example displays the choice label instead of value for choice based fields.
    add_filter( 'gform_entry_field_value', function ( $value, $field, $entry, $form ) {
    $classes = array(
    'GF_Field_Checkbox',
    'GF_Field_MultiSelect',
    'GF_Field_Radio',
    'GF_Field_Select',
    );

    foreach ( $classes as $class ) {
    if ( $field instanceof $class ) {
    $value = $field->get_value_entry_detail( RGFormsModel::get_lead_field_value( $entry, $field ), $currency = '', $use_text = true, $format = 'html' );
    break;
    }
    }

    return $value;
    }, 10, 4 );

    3. File Uploads
    This example shows how you could display uploaded images in a Multi-File upload field.
    add_filter( 'gform_entry_field_value', function ( $value, $field, $entry, $form ) {
    if ( $field->get_input_type() == 'fileupload' && $field->multipleFiles && ! empty( $value ) ) { // Multi-File upload field
    $value = '';
    $raw_value = rgar( $entry, $field->id );
    $files = empty( $raw_value ) ? array() : json_decode( $raw_value, true );
    foreach ( $files as $file_url ) {
    $value .= sprintf( "
    ", $file_url, __( 'Click to view', 'gravityforms' ), $file_url );
    }
    }

    return $value;
    }, 10, 4 );

    And the following does the same for a single file upload field.
    add_filter( 'gform_entry_field_value', function ( $value, $field, $entry, $form ) {
    if ( $field->get_input_type() == 'fileupload' && ! empty( $value ) ) { // Single file upload field
    $file_url = rgar( $entry, $field->id );
    $value = sprintf( "
    ", $file_url, __( 'Click to view', 'gravityforms' ), $file_url );
    }

    return $value;
    }, 10, 4 );

    Additional Notes
    This hook is useful for storing entry values in one format, while displaying them on the entries page in another (refer to the example above).
    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    This filter is located in GFEntryDetail::lead_detail_grid() in entry_detail.php.

    gform_entry_detail

    gform_entry_detail

    DescriptionUsageParametersExamplesPlacementSource Code

    Description
    Use this action hook to add extra text to the Entry detail page after the entry details are displayed and before Notes (if visible).
    Usage
    add_action( 'gform_entry_detail', 'add_to_details', 10, 2 );

    Parameters

    $form Form Object
    The form from which the entry value was submitted.

    $entry Entry Object
    The current entry.

    Examples
    This example displays the listed text on all entries for form id 31 when viewing the Entry details.
    add_action( 'gform_entry_detail', 'add_to_details', 10, 2 );
    function add_to_details( $form, $entry ) {
    if ( $form['id'] == 31 ) {
    echo '

    This hook is used to add additional information to the details page for an entry.

    ';
    }
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    This filter is located in GFEntryDetail::lead_detail_page() in entry_detail.php.