Created
April 4, 2017 16:19
-
-
Save cartpauj/5a15ec794b301448477138ec8bb71bf9 to your computer and use it in GitHub Desktop.
MemberPress + Invisible Recaptcha plugin integration (untested)
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 | |
//Integrates MemberPress with https://wordpress.org/plugins/invisible-recaptcha/ | |
//This is untested code ATM | |
function add_invisible_recaptcha_mepr_signup($membership_ID) { | |
?> | |
<div class="mp-form-row mepr_invisible_recaptcha"> | |
<?php do_action('google_invre_render_widget_action'); ?> | |
</div> | |
<?php | |
} | |
add_filter('mepr-checkout-before-submit', 'add_invisible_recaptcha_mepr_signup'); | |
function validate_invisible_recaptcha_mepr_signup($errors) { | |
$is_valid = apply_filters('google_invre_is_valid_request_filter', true); | |
if(!$is_valid) { | |
$errors[] = "Failed Captcha"; | |
} | |
return $errors; | |
} | |
add_filter('mepr-validate-signup', 'validate_invisible_recaptcha_mepr_signup'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cartpauj
Ah, thanks, that's good to know. I missed that.
I may give that a try instead of ReCaptcha v3 and see if it solves my client's issue.
I appreciate you getting back to me.