Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. function are_email_errors_enabled() {
  3. return (defined('EMAIL_ERRORS_TO_EMAIL') && false !== EMAIL_ERRORS_TO_EMAIL && 0 !== EMAIL_ERRORS_TO_EMAIL);
  4. }
  5.  
  6. function wp_mail_error($subject, $message, $headers = '', $attachments = array()) {
  7. if (! are_email_errors_enabled()) {
  8. return;
  9. }
  10.  
  11. // EMAIL_ERRORS_TO_EMAIL should be set to a valid email or a 'marker-of-somekind',
  12. // since defined constants can't be arrays.
  13. // If the latter, then the filter should produce the valid email or array of emails.
  14. $to = apply_filters('email_errors_to_email', EMAIL_ERRORS_TO_EMAIL);
  15.  
  16. wp_mail($to, $subject, $message, $headers, $attachments);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement