gform_entry_pre_update

Description

Filters the entry before it is updated by an add-on or the API.

When editing entries in the admin, this filter is only used when updating payment information.

Usage

add_filter('gform_entry_pre_update', 'your_function_name', 10, 2);

Parameters

Example

add_filter('gform_entry_pre_update', 'change_entry', 10, 2);
function change_entry($entry, $original_entry) {
    if (rgar($entry, '1.3') == 'Rocketgenius' || rgar($entry, '1.6') == 'Rocketgenius') {
        $entry['2'] = '[email protected]';
    }
    return $entry;
}

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?

Since

This filter was added in Gravity Forms version 1.8.8.

Source Code

This filter is located in GFAPI::update_entry() in includes/api.php and
GF_Forms_Model_Legacy::update_entry() in includes/legacy/forms_model_legacy.php.