Add $this parameter to email class hooks

see #23209
This commit is contained in:
Ewout Fernhout 2019-04-09 15:19:21 +02:00 committed by GitHub
parent d749d3aa80
commit fafc829c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -351,7 +351,7 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_subject() {
return apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->get_option( 'subject', $this->get_default_subject() ) ), $this->object );
return apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->get_option( 'subject', $this->get_default_subject() ) ), $this->object, $this );
}
/**
@ -360,7 +360,7 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_heading() {
return apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->get_option( 'heading', $this->get_default_heading() ) ), $this->object );
return apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->get_option( 'heading', $this->get_default_heading() ) ), $this->object, $this );
}
/**
@ -369,7 +369,7 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_recipient() {
$recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object );
$recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this );
$recipients = array_map( 'trim', explode( ',', $recipient ) );
$recipients = array_filter( $recipients, 'is_email' );
return implode( ', ', $recipients );
@ -391,7 +391,7 @@ class WC_Email extends WC_Settings_API {
$header .= 'Reply-to: ' . $this->get_from_name() . ' <' . $this->get_from_address() . ">\r\n";
}
return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object );
return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this );
}
/**
@ -400,7 +400,7 @@ class WC_Email extends WC_Settings_API {
* @return array
*/
public function get_attachments() {
return apply_filters( 'woocommerce_email_attachments', array(), $this->id, $this->object );
return apply_filters( 'woocommerce_email_attachments', array(), $this->id, $this->object, $this );
}
/**
@ -464,7 +464,7 @@ class WC_Email extends WC_Settings_API {
* @return bool
*/
public function is_enabled() {
return apply_filters( 'woocommerce_email_enabled_' . $this->id, 'yes' === $this->enabled, $this->object );
return apply_filters( 'woocommerce_email_enabled_' . $this->id, 'yes' === $this->enabled, $this->object, $this );
}
/**