Created
August 30, 2024 10:32
-
-
Save rafaelmaeuer/d5244395e1acdf6c1ae7a18a6cb36364 to your computer and use it in GitHub Desktop.
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
<!-- in functions.php add --> | |
function debug_cf7_add_error( $items, $result ) | |
{ | |
if ( 'mail_failed' == $result['status'] ) { | |
// invoke global phpmailer object | |
global $phpmailer; | |
// append error info to ajax response. | |
$items['errorInfo'] = $phpmailer->ErrorInfo; | |
} | |
return $items; | |
} | |
add_action( 'wpcf7_ajax_json_echo', 'debug_cf7_add_error', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment