Add a filter to the Background Updates debug email, matches the filter used on the non-debug post-update emails. Props pento. Fixes #25756

git-svn-id: https://develop.svn.wordpress.org/trunk@26013 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-11-05 02:14:34 +00:00
parent d8f57f88ad
commit 43d50e9c9e
1 changed files with 25 additions and 3 deletions

View File

@ -2393,9 +2393,31 @@ class WP_Automatic_Updater {
}
}
//echo "<h1>\n$subject\n</h1>\n";
//echo "<pre>\n" . implode( "\n", $body ) . "\n</pre>";
$email = array(
'to' => get_site_option( 'admin_email' ),
'subject' => $subject,
'body' => implode( "\n", $body ),
'headers' => ''
);
wp_mail( get_site_option( 'admin_email' ), $subject, implode( "\n", $body ) );
/**
* Filter the debug email that can be sent following an automatic background core update.
*
* @since 3.8.0
*
* @param array $email {
* Array of email arguments that will be passed to wp_mail().
*
* @type string $to The email recipient. An array of emails can be returned, as handled by wp_mail().
* @type string $subject The email's subject.
* @type string $body The email message body.
* @type string $headers Any email headers, defaults to no headers.
* }
* @param int $failures The number of failures encountered while upgrading
* @param mixed $results The results of all updates attempted
*/
$email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
wp_mail( $email['to'], $email['subject'], $email['body'], $email['headers'] );
}
}