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:
westi 2007-09-11 20:49:28 +00:00
parent 446c704af5
commit ca4ddf50f8
1 changed files with 3 additions and 3 deletions

View File

@ -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();