eventsmanager

disable email per category (not fully tested)

Jun 8th, 2026
24,585
0
Never
18
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. add_filter( 'em_booking_email_messages', 'disable_pdf_tickets_for_category_18', 999, 2 );
  3. add_filter( 'em_multiple_booking_email_messages', 'disable_pdf_tickets_for_category_18', 999, 2 );
  4.  
  5. function disable_pdf_tickets_for_category_18( $messages, $EM_Booking ) {
  6. $EM_Event = $EM_Booking->get_event();
  7. if ( ! $EM_Event || empty( $EM_Event->post_id ) ) {
  8. return $messages;
  9. }
  10.  
  11. if ( has_term( 18, 'event-categories', $EM_Event->post_id ) && ! empty( $messages['user']['attachments'] ) ) {
  12. $messages['user']['attachments'] = array_values(
  13. array_filter( $messages['user']['attachments'], function( $attachment ) {
  14. return empty( $attachment['name'] ) || strpos( $attachment['name'], 'Tickets - ' ) === false;
  15. } )
  16. );
  17. }
  18.  
  19. return $messages;
  20. }
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • roostakbitss
    65 days
    # text 0.34 KB | 0 0
    1. so i figured out a way to get free digital products from g2a. more specifically steam gift cards, google play gift cards and amazon gift cards. just watch this video if you dont believe me.
    2.  
    3. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
    4. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
    5. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
Add Comment
Please, Sign In to add comment