Created
January 25, 2014 18:17
-
-
Save strangerstudios/8620962 to your computer and use it in GitHub Desktop.
Don't let existing members downgrade example.
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
/* | |
Don't let exisisting members checkout for free level. | |
*/ | |
function my_pmpro_registration_checks($okay) | |
{ | |
//only check if things are okay so far | |
if($okay) | |
{ | |
global $pmpro_level; | |
if(pmpro_hasMembershipLevel() && $pmpro_level->id == 7) | |
{ | |
pmpro_setMessage("Your existing level has access to everything the Free level does. If you'd still like to change your level, please <a href='/membership-cancel/'>cancel first</a>.", "pmpro_error"); | |
$okay = false; | |
} | |
} | |
return $okay; | |
} | |
add_action("pmpro_registration_checks", "my_pmpro_registration_checks"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment