Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. add_filter( 'notification/carrier/email/recipients', function( $recipients ) {
  2.    
  3.     $exclude_emails = [
  4.         'email1@example.com',
  5.         'email2@example.com',
  6.     ];
  7.  
  8.     foreach ( $exclude_emails as $email ) {
  9.         if ( false !== ( $key = array_search( $email, $recipients ) ) ) {
  10.             unset( $recipients[ $key ] );
  11.         }
  12.     }
  13.    
  14.     return $recipients;
  15.  
  16. }, 10, 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement