Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psaikali/853b94cd05c682efd2b72ba9e95f83cc to your computer and use it in GitHub Desktop.
Save psaikali/853b94cd05c682efd2b72ba9e95f83cc to your computer and use it in GitHub Desktop.
Intercept specific Gravity Forms form submission and process it only if it's the one we want
<?php
/**
* Intercept form submission and process it
*/
function gf_intercept_form_submission( $data, $form ) {
if ( (int) $form['id'] !== (int) get_field( 'submit_project_gf_form_id', 'option' ) ) {
return;
}
// Do something with $data
}
add_action( 'gform_after_submission', 'gf_intercept_form_submission', 10, 2 );
@psaikali
Copy link
Author

psaikali commented Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment