gform_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

Examples

1. Trigger Mailchimp Feeds

This example shows how you can send partial entries to Mailchimp. You’ll also need to use the gform_allow_async_feed_reprocessing filter, so the feeds will be reprocessed on form submission.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_mailchimp_on_partial_entry_save', 10, 2 );
add_action( 'gform_partialentries_post_entry_updated', 'send_to_mailchimp_on_partial_entry_save', 10, 2 );
function send_to_mailchimp_on_partial_entry_save( $partial_entry, $form ) {
	$partial_entry['status'] = 'partial';
	GFAPI::maybe_process_feeds( $partial_entry, $form, 'gravityformsmailchimp' );
}

2. Trigger Webhooks Feeds

This example shows how you can trigger Webhooks feeds for partial entries. You’ll also need to use the gform_allow_async_feed_reprocessing filter, so the feeds will be reprocessed on form submission.

add_action( 'gform_partialentries_post_entry_saved', 'webhooks_on_partial_entry_save', 10, 2 );
add_action( 'gform_partialentries_post_entry_updated', 'webhooks_on_partial_entry_save', 10, 2 );
function webhooks_on_partial_entry_save( $partial_entry, $form ) {
	$partial_entry['status'] = 'partial';
	GFAPI::maybe_process_feeds( $partial_entry, $form, 'gravityformswebhooks' );
}

3. Trigger Zapier Feeds

This example shows how you can send partial entries to Zapier. You’ll also need to use the gform_allow_async_feed_reprocessing filter, so the feeds will be reprocessed on form submission.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_zapier_on_partial_entry_save', 10, 2 );
add_action( 'gform_partialentries_post_entry_updated', 'send_to_zapier_on_partial_entry_save', 10, 2 );
function send_to_zapier_on_partial_entry_save( $partial_entry, $form ) {
	$partial_entry['status'] = 'partial';
	GFAPI::maybe_process_feeds( $partial_entry, $form, 'gravityformszapier' );
}

4. Trigger HubSpot Feeds

This example shows how you can trigger HubSpot feeds for partial entries. You’ll also need to use the gform_allow_async_feed_reprocessing filter, so the feeds will be reprocessed on form submission.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_hubspot_on_partial_entry_save', 10, 2 );
add_action( 'gform_partialentries_post_entry_updated', 'send_to_hubspot_on_partial_entry_save', 10, 2 );
function send_to_hubspot_on_partial_entry_save( $partial_entry, $form ) {
	$partial_entry['status'] = 'partial';
	GFAPI::maybe_process_feeds( $partial_entry, $form, 'gravityformshubspot' );
}

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.