bookmark_bordergform_after_update_entry

Description

This hook fires after the entry has been updated via the entry detail page.

Usage

The following would run for any form:

add_action( 'gform_after_update_entry', 'your_function_name', 10, 2 );

To target a specific form append the form id to the hook name. (format: gform_after_update_entry_FORMID)

add_action( 'gform_after_update_entry_10', 'your_function_name', 10, 2 );

Parameters

  • $form

    The form object for the entry.

  • $entry_id integer

    The entry ID.

  • $original_entry Entry Object

    The entry before being updated. Since 1.9.12.9.

Examples

1. Update entry properties.

This example sets the entry as unread and stars it.

add_action( 'gform_after_update_entry', 'update_entry', 10, 2 );
function update_entry( $form, $entry_id ) {
    GFAPI::update_entry_property( $entry_id, 'is_read', 0 );
    GFAPI::update_entry_property( $entry_id, 'is_starred', 1 );
}

2. Log the entry before and after update.

add_action( 'gform_after_update_entry', 'log_post_update_entry', 10, 3 );
function log_post_update_entry( $form, $entry_id, $original_entry ) {
    $entry = GFAPI::get_entry( $entry_id );
    GFCommon::log_debug( 'gform_after_update_entry: original_entry => ' . print_r( $original_entry, 1 ) );
    GFCommon::log_debug( 'gform_after_update_entry: updated entry => ' . print_r( $entry, 1 ) );
}

3. Trigger Zapier Feed

This example shows how you can send the updated entry to Zapier.

add_action( 'gform_after_update_entry', 'send_to_zapier_on_update', 10, 2 );
function send_to_zapier_on_update( $form, $entry_id ) {
    $entry = GFAPI::get_entry( $entry_id );
    GFZapier::send_form_data_to_zapier( $entry, $form );
}

4. Trigger MailChimp Feed

This example shows how you can send the updated entry to MailChimp.

add_action( 'gform_after_update_entry', 'send_to_mailchimp_on_update', 10, 2 );
function send_to_mailchimp_on_update( $form, $entry_id ) {
    if ( function_exists( 'gf_mailchimp' ) ) {
        $entry = GFAPI::get_entry( $entry_id );
        gf_mailchimp()->maybe_process_feed( $entry, $form );
    }
}

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