Forked from strangerstudios/my_pmpro_registration_checks.php
Last active
August 29, 2015 14:09
-
-
Save mrkellysch/347625af75640a7a1198 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| /* | |
| Plugin Name: PMPro stop upgrade level | |
| Plugin URI: https://gist.github.com/strangerstudios/8620962 | |
| Description: Prevent students from upgrading to teacher level. | |
| Version: .4.2.1 | |
| Author: Stranger Studios | |
| Author URI: http://www.strangerstudios.com | |
| */ | |
| /* | |
| Don't let exisisting members checkout for higher level. | |
| */ | |
| function student_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("You cannot upgrade from a student account. Please logout from the student account and signup for this level", "pmpro_error"); | |
| $okay = false; | |
| } | |
| } | |
| return $okay; | |
| } | |
| add_action("pmpro_registration_checks", "student_pmpro_registration_checks"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment