From 43d50e9c9ef5010aa4eed2fd764cced19631b19b Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 5 Nov 2013 02:14:34 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/class-wp-upgrader.php | 28 ++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index 90b9658d57..b9b80e5776 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -2393,9 +2393,31 @@ class WP_Automatic_Updater { } } - //echo "

\n$subject\n

\n"; - //echo "
\n" . implode( "\n", $body ) . "\n
"; + $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'] ); } }