Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function are_email_errors_enabled() {
- return (defined('EMAIL_ERRORS_TO_EMAIL') && false !== EMAIL_ERRORS_TO_EMAIL && 0 !== EMAIL_ERRORS_TO_EMAIL);
- }
- function wp_mail_error($subject, $message, $headers = '', $attachments = array()) {
- if (! are_email_errors_enabled()) {
- return;
- }
- // EMAIL_ERRORS_TO_EMAIL should be set to a valid email or a 'marker-of-somekind',
- // since defined constants can't be arrays.
- // If the latter, then the filter should produce the valid email or array of emails.
- $to = apply_filters('email_errors_to_email', EMAIL_ERRORS_TO_EMAIL);
- wp_mail($to, $subject, $message, $headers, $attachments);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement