Skip to content

Instantly share code, notes, and snippets.

@mattneal-stafflink
Created January 19, 2022 05:01
Show Gist options
  • Save mattneal-stafflink/bcf9bca4e03139cb1ed1a3e7f908baeb to your computer and use it in GitHub Desktop.
Save mattneal-stafflink/bcf9bca4e03139cb1ed1a3e7f908baeb to your computer and use it in GitHub Desktop.
Save partial entries to Hubspot
<?php
// Fires when Gravity Forms saves a partial entry
add_action( 'gform_partialentries_post_entry_saved', 'matt_neal_is_god', 10, 2 );
function matt_neal_is_god( $partial_entry, $form ) {
GFCommon::log_debug( __METHOD__ . '(): running.' );
// If we have Gravity Forms Hubspot extention...
if ( function_exists( 'gf_hspot' ) ) {
$partial_entry['status'] = 'partial';
GFCommon::log_debug( __METHOD__ . '(): trigger Hubspot for Partial Entry: ' . print_r( $partial_entry, true ) );
// in the wise words of Homer Simpson, "One two, better not sue!"
gf_hspot()->maybe_process_feed( $partial_entry, $form );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment