Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Disable Registration based on Register Helper field value
- Add this code to your active theme's functions.php or
- a custom plugin.
- */
- function my_pmpro_registration_checks($okay)
- {
- //only check if things are okay so far
- if($okay)
- {
- // global $pmpro_level;
- if(isset($_REQUEST['not_permitted']) && $_REQUEST['not_permitted'] == 'yes')
- {
- pmpro_setMessage("You are not permitted to register for this level", "pmpro_error");
- $okay = false;
- }
- }
- return $okay;
- }
- add_action("pmpro_registration_checks", "my_pmpro_registration_checks");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement