SHARE
TWEET

Untitled

a guest Oct 18th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top