Skip to content

Instantly share code, notes, and snippets.

@cartpauj
Created April 4, 2017 16:19
Show Gist options
  • Save cartpauj/5a15ec794b301448477138ec8bb71bf9 to your computer and use it in GitHub Desktop.
Save cartpauj/5a15ec794b301448477138ec8bb71bf9 to your computer and use it in GitHub Desktop.
MemberPress + Invisible Recaptcha plugin integration (untested)
<?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');
@pixelloop
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment