Allow the wp_mail filter to change the passed data. Fixes #4511 props ryan.
git-svn-id: https://develop.svn.wordpress.org/trunk@6084 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c3b56d7710
commit
e0a59804ee
@ -158,6 +158,9 @@ endif;
|
||||
|
||||
if ( !function_exists( 'wp_mail' ) ) :
|
||||
function wp_mail( $to, $subject, $message, $headers = '' ) {
|
||||
// Compact the input, apply the filters, and extract them back out
|
||||
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) );
|
||||
|
||||
global $phpmailer;
|
||||
|
||||
// (Re)create it, if it's gone missing
|
||||
@ -167,9 +170,6 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
|
||||
$phpmailer = new PHPMailer();
|
||||
}
|
||||
|
||||
// Compact the input, apply the filters, and extract them back out
|
||||
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ), EXTR_SKIP );
|
||||
|
||||
// Headers
|
||||
if ( empty( $headers ) ) {
|
||||
$headers = array();
|
||||
|
Loading…
Reference in New Issue
Block a user