JReviews logo Docs
Menu
Version

enable_captcha

Filter the captcha setting so it can be controlled programatically.

Filter
System
Since 3.13.0

You need to have a working knowledge of Hooks before you get started.

Parameters

Name Type Description
$enabled parameter (boolean)
$auth parameter (JReviews\Services\Authentication::class) authentication instance

Boilerplate Code

Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.

Clickfwd\Hook\Filter::add('enable_captcha', function($enabled, $auth)
{
    // Uncomment line below to view available data passed into hook
    // fwd_dd($enabled, $auth);

    return $enabled;
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Examples

Disable captcha for specific user IDs

When captcha is enabled for registered users, it applies to all users. The example below allows disabling the recaptcha for specific user IDs.

Clickfwd\Hook\Filter::add('enable_captcha', function($enabled, $auth) {
	$trustedUserIds = [1,2,3];
	if (in_array($auth->id, $trustedUserIds)) {
		return false;
	}
	return $enabled;
});

Source Files

  • /services/authentication/authentication.php