Skip to content

Commit 3c06d6d

Browse files
author
Antti Kuosmanen
committed
Syntax colouring on github for php code
1 parent 55e1956 commit 3c06d6d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ Example use:
5757

5858
Send a thank you email to the email in the submission
5959

60-
```
60+
```php
61+
<?php
6162
add_action( 'wplf_post_validate_submission', 'my_email_thankyou' );
6263
function my_email_thankyou( $return ) {
6364
// do nothing if form validation failed
@@ -80,7 +81,8 @@ Example use:
8081

8182
Make sure people don't include dumb questions about Contact Form 7 in the message field.
8283

83-
```
84+
```php
85+
<?php
8486
add_filter( 'wplf_validate_submission', 'my_form_validation' );
8587
function 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
}

0 commit comments

Comments
 (0)