Allow the wp_mail filter to change the passed data. Fixes #4511 props ryan.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
446c704af5
commit
ca4ddf50f8
|
@ -158,6 +158,9 @@ endif;
|
||||||
|
|
||||||
if ( !function_exists( 'wp_mail' ) ) :
|
if ( !function_exists( 'wp_mail' ) ) :
|
||||||
function wp_mail( $to, $subject, $message, $headers = '' ) {
|
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;
|
global $phpmailer;
|
||||||
|
|
||||||
// (Re)create it, if it's gone missing
|
// (Re)create it, if it's gone missing
|
||||||
|
@ -167,9 +170,6 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
|
||||||
$phpmailer = new PHPMailer();
|
$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
|
// Headers
|
||||||
if ( empty( $headers ) ) {
|
if ( empty( $headers ) ) {
|
||||||
$headers = array();
|
$headers = array();
|
||||||
|
|
Loading…
Reference in New Issue