Last active
June 27, 2023 20:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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