Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active June 27, 2023 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/916101ac0c31499c6328b4b18dcca692 to your computer and use it in GitHub Desktop.
Save Pebblo/916101ac0c31499c6328b4b18dcca692 to your computer and use it in GitHub Desktop.
Example of how to skip the Advanced noCaptcha & invisible Captcha plugin from validating the recaptcha response on the EE login step as it is not included in the request and will always fail.
<?php // Please do not include the opening PHP tag if you alread have one.
add_filter( 'anr_verify_captcha_pre', 'tw_ee_skip_recaptcha_verify_for_ee_login', 10, 2);
function tw_ee_skip_recaptcha_verify_for_ee_login($captcha_pre, $response) {
if(
class_exists('EE_Registry')
&& ( EE_Registry::instance()->REQ->get('step', '') === 'wpuser_login'
|| EE_Registry::instance()->REQ->get('action', '') === 'ee_process_login_form' )
) {
return true;
}
return $captcha_pre;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment