bookmark_bordergform_partialentries_post_EVENT

Description

Perform a custom action when the partial entry has been saved or updated.

Usage

Entry Saved

The following would run for all forms with the partial entries feature enabled when the entry_saved event occurs.

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

Entry Updated

The following would run for all forms with the partial entries feature enabled when the entry_updated event occurs.

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

Parameters

  • $partial_entry Entry Object

    The partial entry object.

  • $form

    The current form object.

Examples

1. Trigger MailChimp Feeds.

This example shows how you can send new partial entries to MailChimp.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_mailchimp_on_partial_entry_saved', 10, 2 );
function send_to_mailchimp_on_partial_entry_saved( $partial_entry, $form ) {
    if ( function_exists( 'gf_mailchimp' ) ) {
        gf_mailchimp()->maybe_process_feed( $partial_entry, $form );
    }
}

2. Trigger Zapier Feeds.

This example shows how you can send new partial entries to Zapier.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_zapier_on_partial_entry_saved', 10, 2 );
function send_to_zapier_on_partial_entry_saved( $partial_entry, $form ) {
    if ( class_exists( 'GFZapier' ) ) {
        GFZapier::send_form_data_to_zapier( $partial_entry, $form );
    }
}

Note: Depending on how long it takes the third-party API to respond to requests when processing the add-on feeds it could cause a delay when changing form pages.

Since

This hook was added in version 1.0-beta-2.3.

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This action hook is located in GF_Partial_Entries::maybe_save_partial_entry() in class-gf-partial-entries.php