Contents
Description
The wsf_submit_block_random_text filter hook allows developers to customize how WS Form detects randomly generated text and suspicious email addresses in form submissions.
This filter runs for each supported field when Random Text Detection is enabled on a form under Settings > Spam Protection. It allows you to override the default detection result, exclude specific values from spam detection, or implement your own detection logic.
Return true to flag a field value as random text spam, or false to allow it. Return the original value of $match to preserve the default detection behavior.
Usage
add_filter( 'wsf_submit_block_random_text', 'my_hook_function', 10, 5 );
Parameters
Example
// Callback function for the wsf_submit_block_random_text filter hook
function my_hook_function( $match, $field_value, $field, $form, $submit ) {
// Your code here ...
// Return value
return $match;
}
// Add a callback function for the wsf_submit_block_random_text filter hook
add_filter( 'wsf_submit_block_random_text', 'my_hook_function', 10, 5 );