Created
January 4, 2019 14:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://gist.github.com/psaikali/2b29e6e83f50718625af27c2958c828f for the first part