Skip to content

Commit

Permalink
Contact Form: Add filters to allow Akismet to add custom form fields …
Browse files Browse the repository at this point in the history
…for better anti-spam effectiveness. (#21123)

Co-authored-by: Jeremy Herve <[email protected]>
  • Loading branch information
cfinke and jeherve authored Sep 23, 2021
1 parent 6781060 commit 6d71e2b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Added two filters to improve anti-spam functionality in the Contact Form.
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,16 @@ function prepare_for_akismet( $form ) {
}
}

return $form;
/**
* Filter the values that are sent to Akismet for the spam check.
*
* @module contact-form
*
* @since 10.2.0
*
* @param array $form The form values being sent to Akismet.
*/
return apply_filters( 'jetpack_contact_form_akismet_values', $form );
}

/**
Expand Down Expand Up @@ -2264,7 +2273,16 @@ static function parse( $attributes, $content ) {

$r .= '</div>';

return $r;
/**
* Filter the contact form, allowing plugins to modify the HTML.
*
* @module contact-form
*
* @since 10.2.0
*
* @param string $r The contact form HTML.
*/
return apply_filters( 'jetpack_contact_form_html', $r );
}

/**
Expand Down

0 comments on commit 6d71e2b

Please sign in to comment.