Update abstract-wc-email.php

wp_mail does return a bool just in case something goes wrong with the function so it might be nice to carry it through. While extending this class I thought it might be a good idea to double check everything I can.
This commit is contained in:
bolderelements 2014-03-23 13:09:01 -04:00 committed by Mike Jolley
parent 27d940ea94
commit eb990d8b3b
1 changed files with 4 additions and 2 deletions

View File

@ -542,18 +542,20 @@ abstract class WC_Email extends WC_Settings_API {
* @param mixed $message
* @param string $headers
* @param string $attachments
* @return void
* @return bool
*/
function send( $to, $subject, $message, $headers, $attachments ) {
add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
wp_mail( $to, $subject, $message, $headers, $attachments );
$return = wp_mail( $to, $subject, $message, $headers, $attachments );
remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
return $return;
}
/**