Changeset 9213
- Timestamp:
- 10/16/2008 08:57:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r9200 r9213 254 254 * @param string $message Message contents 255 255 * @param string|array $headers Optional. Additional headers. 256 * @param string|array $attachments Optional. Files to attach. 256 257 * @return bool Whether the email contents were sent successfully. 257 258 */ 258 function wp_mail( $to, $subject, $message, $headers = '' ) {259 function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { 259 260 // Compact the input, apply the filters, and extract them back out 260 extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) ); 261 extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ) ); 262 263 if ( !is_array($attachments) ) 264 $attachments = explode( "\n", $attachments ); 261 265 262 266 global $phpmailer; … … 404 408 foreach( (array) $headers as $name => $content ) { 405 409 $phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); 410 } 411 } 412 413 error_log($attachments); 414 if ( !empty( $attachments ) ) { 415 foreach ( $attachments as $attachment ) { 416 $phpmailer->AddAttachment($attachment); 406 417 } 407 418 }
Note: See TracChangeset
for help on using the changeset viewer.