wsf_submit_block_random_text

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

  1. $match Boolean
    Boolean indicating whether the field value matches a spam pattern.
  2. $field_value String
    The submitted field value.
  3. $field Object
    The field being checked.
  4. $form Form Object
    The form associated with the submission.
  5. $submit Submit Object
    The submission being processed.

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 );