Advertisement
Guest User

Untitled

a guest
Mar 8th, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. add_filter( 'notification/carrier/email/recipients', function( $recipients, $carrier, $trigger ) {
  2.  
  3.     // Check if registered Trigger is the one you need.
  4.     if ( 'comment/comment/added' !== $trigger->get_slug() ) {
  5.         return;
  6.     }
  7.  
  8.     $excluded_emails = [
  9.         'email@example.com',
  10.         'another@example.com',
  11.     ];
  12.  
  13.     return array_diff( $recipients, $excluded_emails );
  14.  
  15. }, 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement