-
-
Save Pebblo/2ebecaacb210a71897aaadf23db9fdf9 to your computer and use it in GitHub Desktop.
Example of how to log the request data from an invalid form submission
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 | |
if ( ! function_exists('write_log')) { | |
function write_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} | |
} | |
add_action('AHEE__EE_Form_Section_Proper__receive_form_submission__end', 'tw_ee_log_invalid_form', 10, 3); | |
function tw_ee_log_invalid_form( $req_data, $form, $validate) { | |
if(! $form->is_valid() ) { | |
write_log( $req_data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment