Merge pull request #9669 from ymazuz/email-from-filters

Add filters for From name/address to WC_Email (#9653)
This commit is contained in:
Mike Jolley 2015-11-23 18:47:52 +00:00
commit 7b5bd7d4b8
1 changed files with 4 additions and 2 deletions

View File

@ -435,7 +435,8 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_from_name() {
return wp_specialchars_decode( esc_html( get_option( 'woocommerce_email_from_name' ) ), ENT_QUOTES );
$from_name = apply_filters( 'woocommerce_email_from_name', get_option( 'woocommerce_email_from_name' ), $this );
return wp_specialchars_decode( esc_html( $from_name ), ENT_QUOTES );
}
/**
@ -443,7 +444,8 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_from_address() {
return sanitize_email( get_option( 'woocommerce_email_from_address' ) );
$from_address = apply_filters( 'woocommerce_email_from_address', get_option( 'woocommerce_email_from_address' ), $this );
return sanitize_email( $from_address );
}
/**