$value ) { if ( ! in_array( $key, (array) $ignore ) ) $c["$key"] = $value; } $query_string = ''; foreach ( $c as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes( (string) $data ) ) . '&'; $response = akismet_http_post( $query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port ); if ( 'true' == $response[1] ) $spam = true; $spam = apply_filters( 'wpcf7_akismet_comment_check', $spam, $c ); return $spam; } /* Messages */ add_filter( 'wpcf7_messages', 'wpcf7_akismet_messages' ); function wpcf7_akismet_messages( $messages ) { return array_merge( $messages, array( 'akismet_says_spam' => array( 'description' => __( "Akismet judged the sending activity as spamming", 'wpcf7' ), 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'wpcf7' ) ) ) ); } add_filter( 'wpcf7_display_message', 'wpcf7_akismet_display_message', 10, 2 ); function wpcf7_akismet_display_message( $message, $status ) { if ( 'spam' == $status && empty( $message ) ) $message = wpcf7_get_message( 'akismet_says_spam' ); return $message; } ?>