File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ Example use:
5757
5858Send a thank you email to the email in the submission
5959
60- ```
60+ ``` php
61+ <?php
6162add_action( 'wplf_post_validate_submission', 'my_email_thankyou' );
6263function my_email_thankyou( $return ) {
6364 // do nothing if form validation failed
@@ -80,7 +81,8 @@ Example use:
8081
8182Make sure people don't include dumb questions about Contact Form 7 in the message field.
8283
83- ```
84+ ``` php
85+ <?php
8486add_filter( 'wplf_validate_submission', 'my_form_validation' );
8587function my_form_validation( $return ) {
8688 // skip this validation if submission has already failed
@@ -91,7 +93,7 @@ function my_form_validation( $return ) {
9193 // don't allow contact form 7 to be mentioned in the message field
9294 if( false !== strpos( strtolower( $_POST['message'] ), 'contact form 7' ) ) {
9395 $return->ok = 0;
94- $return->error = sprintf( __(' I don't like Contact Form 7 so I won't accept your submission.' ), intval( $_POST['_form_id'] ) );
96+ $return->error = sprintf( __(" I don't like Contact Form 7 so I won't accept your submission." ), intval( $_POST['_form_id'] ) );
9597 }
9698 return $return;
9799}
You can’t perform that action at this time.
0 commit comments