Advertisement
eventsmanager

Limit Ticket Availability

Mar 5th, 2013
220
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);
Advertisement
RAW Paste Data Copied
Advertisement