Fix woocommerce_email_from_* filtering
- apply filters before sanitizing - send entire $this as argument so hooked functions can access any properties of the WC_Email (subclass) instance
This commit is contained in:
parent
afb19228a9
commit
9e5098627c
|
@ -435,8 +435,8 @@ class WC_Email extends WC_Settings_API {
|
|||
* @return string
|
||||
*/
|
||||
public function get_from_name() {
|
||||
$from_name = wp_specialchars_decode( esc_html( get_option( 'woocommerce_email_from_name' ) ), ENT_QUOTES );
|
||||
return apply_filters( 'woocommerce_email_from_name', $from_name, $this->id, $this->object );
|
||||
$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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -444,8 +444,8 @@ class WC_Email extends WC_Settings_API {
|
|||
* @return string
|
||||
*/
|
||||
public function get_from_address() {
|
||||
$from_address = return sanitize_email( get_option( 'woocommerce_email_from_address' ) );
|
||||
return apply_filters( 'woocommerce_email_from_address', $from_address, $this->id, $this->object );
|
||||
$from_address = apply_filters( 'woocommerce_email_from_address', get_option( 'woocommerce_email_from_address' ), $this );
|
||||
return sanitize_email( $from_address );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue