mirror of
https://github.com/WordPress/WordPress.git
synced 2024-06-26 06:45:07 +02:00
Site Health: Allow attachments to be added to recovery mode emails.
The `wp_mail()` function has the ability to add attachments to emails. There is currently no way to add attachments to the recovery mode email sent out to site admins when a PHP error is encountered on their site. This change adds that ability through the use of the `recovery_mode_email` filter, allowing developers to use the full capabilities of `wp_mail()`. Props desrosj, timothyblynjacobs. Fixes #51276. Built from https://develop.svn.wordpress.org/trunk@48964 git-svn-id: http://core.svn.wordpress.org/trunk@48726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
04c8217724
commit
8e9e942215
|
@ -194,11 +194,12 @@ When seeking help with this issue, you may be asked for some of the following in
|
||||||
);
|
);
|
||||||
|
|
||||||
$email = array(
|
$email = array(
|
||||||
'to' => $this->get_recovery_mode_email_address(),
|
'to' => $this->get_recovery_mode_email_address(),
|
||||||
/* translators: %s: Site title. */
|
/* translators: %s: Site title. */
|
||||||
'subject' => __( '[%s] Your Site is Experiencing a Technical Issue' ),
|
'subject' => __( '[%s] Your Site is Experiencing a Technical Issue' ),
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
'headers' => '',
|
'headers' => '',
|
||||||
|
'attachments' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,10 +210,11 @@ When seeking help with this issue, you may be asked for some of the following in
|
||||||
* @param array $email {
|
* @param array $email {
|
||||||
* Used to build a call to wp_mail().
|
* Used to build a call to wp_mail().
|
||||||
*
|
*
|
||||||
* @type string|array $to Array or comma-separated list of email addresses to send message.
|
* @type string|array $to Array or comma-separated list of email addresses to send message.
|
||||||
* @type string $subject Email subject
|
* @type string $subject Email subject
|
||||||
* @type string $message Message contents
|
* @type string $message Message contents
|
||||||
* @type string|array $headers Optional. Additional headers.
|
* @type string|array $headers Optional. Additional headers.
|
||||||
|
* @type string|array $attachments Optional. Files to attach.
|
||||||
* }
|
* }
|
||||||
* @param string $url URL to enter recovery mode.
|
* @param string $url URL to enter recovery mode.
|
||||||
*/
|
*/
|
||||||
|
@ -222,7 +224,8 @@ When seeking help with this issue, you may be asked for some of the following in
|
||||||
$email['to'],
|
$email['to'],
|
||||||
wp_specialchars_decode( sprintf( $email['subject'], $blogname ) ),
|
wp_specialchars_decode( sprintf( $email['subject'], $blogname ) ),
|
||||||
$email['message'],
|
$email['message'],
|
||||||
$email['headers']
|
$email['headers'],
|
||||||
|
$email['attachments']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $switched_locale ) {
|
if ( $switched_locale ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.6-alpha-48963';
|
$wp_version = '5.6-alpha-48964';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user