[Plugin: Contact Form 7] modify submit.result['message'] in hook
-
Hello All,
is there a way to modify the $result object in the hooked function on wpcf7_mail_sent action hook? (‘my_message_1’ and ‘my_message_2’ are newly/hacky added to wpcf7_messages in /cf7/includes/functions.php)
function my_wpcf7_mail_sent_hook( $form ) { $title = $form->title; if ( 'First Form' == $title ) { require_once('FIRST.class.php'); $first = new FIRST(); if ( $first->function() ) { $form->result['message'] = $form->message('my_message_1'); } else { $form->result['message'] = $form->message('my_message_2'); } } elseif ( 'Second Form' == $title ) { ... } } add_action( 'wpcf7_mail_sent', 'my_wpcf7_mail_sent_hook');
Thank you in advance,
Lili
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Contact Form 7] modify submit.result['message'] in hook’ is closed to new replies.