Description

Filters setting properties applied to the Custom Captcha Addon.

Parameters

$settings
(array) (Required) Minimum integer, maximum integer, and operators that will be used.

Source

wpforms-captcha/class-captcha.php

More Information

The wpforms_math_captcha filter is applied to an array that sets minimum and maximum numbers, as well as the type of calculations used with those values (addition, multiplication, etc). It can be used to change the integer range and operators allowed in a custom captcha field.

Example

/**
 * Filters setting properties applied to the Custom Captcha addon.
 *
 * @link   https://wpforms.com/developers/wpforms_math_captcha/
 *
 * @param  array $settings
 * @return array
 */
function wpf_dev_math_captcha_settings( $settings ) {
     
    /* Default settings
        array(
            'min' => 1,
            'max' => 15,
            'cal' => array( '+', '*' ),
        );
     */
 
    // Change max number 4 for easier math
    $settings['max'] = 4;
 
    return $settings;
}
add_filter( 'wpforms_math_captcha', 'wpf_dev_math_captcha_settings' );

Snippet Reference: Change the Captcha Math for the Custom Captcha Addon