You appear to be a bot. Output may be restricted
Description
Ensure that any Akismet-added form fields are included in the comment-check call.
Usage
$array = Akismet::prepare_custom_form_values( $form, $data );
Parameters
- $form
- ( array ) required –
- $data
- ( array ) optional – Some plugins will supply the POST data via the filter, since they don't read it directly from $_POST.
Returns
array $form
Source
File name: akismet/class.akismet.php
Lines:
1 to 21 of 21
public static function prepare_custom_form_values( $form, $data = null ) { if ( is_null( $data ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $data = $_POST; } $prefix = 'ak_'; // Contact Form 7 uses _wpcf7 as a prefix to know which fields to exclude from comment_content. if ( 'wpcf7_akismet_parameters' === current_filter() ) { $prefix = '_wpcf7_ak_'; } foreach ( $data as $key => $val ) { if ( 0 === strpos( $key, $prefix ) ) { $form[ 'POST_ak_' . substr( $key, strlen( $prefix ) ) ] = $val; } } return $form; }