eventsmanager

Limit Ticket Availability

Mar 5th, 2013
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. This snippet is already working in the latest EM version
  3. allowing tickets to limit per user role
  4. */
  5. function em_mod_ticket_available($result,$EM_Ticket){
  6. global $current_user;
  7. $user_roles = $current_user->roles;
  8. $user_role = array_shift($user_roles);
  9. if ( $EM_Ticket->ticket_members && $EM_Ticket->ticket_name == 'General Admin' ){
  10. if ( $user_role == 'administrator' ){
  11. return false;
  12. }
  13. }
  14. return $result;
  15. }
  16. add_filter('em_ticket_is_available','em_mod_ticket_available',10,2);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×