Created
September 30, 2020 13:11
-
-
Save DuckDivers/cbb7acb489cae29df8c215c9691bb0f6 to your computer and use it in GitHub Desktop.
Sends CF7 Output to the error log - wherever that is
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 | |
// include in functions.php or in a plugin. | |
// Use var_export, print_r, var_dump, whatever | |
add_action( 'wpcf7_before_send_mail', 'he_debug_cf7_output'); | |
function he_debug_cf7_output( $contact_form ) { | |
$submission = WPCF7_Submission::get_instance(); | |
if ( $submission ) { | |
$posted_data = $submission->get_posted_data(); | |
// Dump output to error log | |
ob_start(); | |
var_export($posted_data); | |
error_log(ob_get_clean()); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment