diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 56d2f0b53e..d2d723a3d2 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -260,10 +260,14 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() // Headers if ( empty( $headers ) ) { $headers = array(); - } elseif ( !is_array( $headers ) ) { - // Explode the headers out, so this function can take both - // string headers and an array of headers. - $tempheaders = (array) explode( "\n", $headers ); + } else { + if ( !is_array( $headers ) ) { + // Explode the headers out, so this function can take both + // string headers and an array of headers. + $tempheaders = (array) explode( "\n", $headers ); + } else { + $tempheaders = $headers; + } $headers = array(); // If it's actually got contents