From e0a59804eede80a0b9d927ce5b616cfdbe8ae237 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 11 Sep 2007 20:49:28 +0000 Subject: [PATCH] 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 --- wp-includes/pluggable.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index ae1d4142ca..4bbcaacb8f 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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();