Make WordPress Core


Ignore:
Timestamp:
11/05/2013 02:14:34 AM (13 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r25977 r26013  
    23942394                }
    23952395
    2396                 //echo "<h1>\n$subject\n</h1>\n";
    2397                 //echo "<pre>\n" . implode( "\n", $body ) . "\n</pre>";
    2398 
    2399                 wp_mail( get_site_option( 'admin_email' ), $subject, implode( "\n", $body ) );
     2396                $email = array(
     2397                        'to'      => get_site_option( 'admin_email' ),
     2398                        'subject' => $subject,
     2399                        'body'    => implode( "\n", $body ),
     2400                        'headers' => ''
     2401                );
     2402
     2403                /**
     2404                 * Filter the debug email that can be sent following an automatic background core update.
     2405                 *
     2406                 * @since 3.8.0
     2407                 *
     2408                 * @param array $email {
     2409                 *     Array of email arguments that will be passed to wp_mail().
     2410                 *
     2411                 *     @type string $to      The email recipient. An array of emails can be returned, as handled by wp_mail().
     2412                 *     @type string $subject The email's subject.
     2413                 *     @type string $body    The email message body.
     2414                 *     @type string $headers Any email headers, defaults to no headers.
     2415                 * }
     2416                 * @param int   $failures The number of failures encountered while upgrading
     2417                 * @param mixed $results  The results of all updates attempted
     2418                 */
     2419                $email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
     2420
     2421                wp_mail( $email['to'], $email['subject'], $email['body'], $email['headers'] );
    24002422        }
    24012423}
Note: See TracChangeset for help on using the changeset viewer.