Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created January 11, 2018 10:22
Show Gist options
  • Save andrewlimaza/52cd07b5a61a51ad692ad6b92b5ffd48 to your computer and use it in GitHub Desktop.
Save andrewlimaza/52cd07b5a61a51ad692ad6b92b5ffd48 to your computer and use it in GitHub Desktop.
Hide Recaptcha for Paid Memberships Pro Checkout for certain levels.
<?php
/**
* Remove the Captcha field for particular membership level.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function remove_pmpro_recaptcha() {
// Assume user is checking out for level 5. Change according to level you would like to hide the Recaptcha field.
if( $_REQUEST['level'] == 5 ){
remove_action( "init", "pmpro_init_recaptcha", 20 );
}
}
add_action( "init", "remove_pmpro_recaptcha" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment