Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. /*
  3. Disable Registration based on Register Helper field value
  4. Add this code to your active theme's functions.php or
  5. a custom plugin.
  6. */
  7. function my_pmpro_registration_checks($okay)
  8. {
  9. //only check if things are okay so far
  10. if($okay)
  11. {
  12. // global $pmpro_level;
  13.  
  14. if(isset($_REQUEST['not_permitted']) && $_REQUEST['not_permitted'] == 'yes')
  15. {
  16. pmpro_setMessage("You are not permitted to register for this level", "pmpro_error");
  17.  
  18. $okay = false;
  19. }
  20. }
  21.  
  22. return $okay;
  23. }
  24. add_action("pmpro_registration_checks", "my_pmpro_registration_checks");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement