enable_captcha

Filter Hook System Since 3.13.0

Filter the captcha setting so it can be controlled programatically.

Parameters

$enabled

(boolean)

$auth

(JReviews\Services\Authentication::class) authentication instance

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

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
  // For JReviews 3.x and earlier use dd instead of fwd_dd
  // 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

  • /services/authentication/authentication.php