From 7ae2e66e58726396746099d40858e0f4be148887 Mon Sep 17 00:00:00 2001 From: Shadi Manna Date: Thu, 20 Apr 2023 15:13:28 +0200 Subject: [PATCH] Remove the default text in "Additional content" being sent for all emails when the field is empty for Admin New Order email --- plugins/woocommerce/changelog/fix-issue-36360 | 2 +- .../includes/emails/class-wc-email-new-order.php | 12 ++++++++++++ .../woocommerce/includes/emails/class-wc-email.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/changelog/fix-issue-36360 b/plugins/woocommerce/changelog/fix-issue-36360 index c0fbc46cc52..994524f8750 100644 --- a/plugins/woocommerce/changelog/fix-issue-36360 +++ b/plugins/woocommerce/changelog/fix-issue-36360 @@ -1,4 +1,4 @@ Significance: patch Type: fix -Remove the default text in "Additional content" being sent for all emails when the field is empty +Remove the default text in "Additional content" being sent for all emails when the field is empty for Admin New Order email \ No newline at end of file diff --git a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php index e357c11ff73..5cb37dde2ae 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php @@ -165,6 +165,18 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) : return __( 'Congratulations on the sale.', 'woocommerce' ); } + /** + * Return content from the additional_content field. + * + * Displayed above the footer. + * + * @since 3.7.0 + * @return string + */ + public function get_additional_content() { + return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content' ) ), $this->object, $this ); + } + /** * Initialise settings form fields. */ diff --git a/plugins/woocommerce/includes/emails/class-wc-email.php b/plugins/woocommerce/includes/emails/class-wc-email.php index 4aaaef9e694..aaa758fe4bb 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email.php +++ b/plugins/woocommerce/includes/emails/class-wc-email.php @@ -400,7 +400,7 @@ class WC_Email extends WC_Settings_API { * @return string */ public function get_additional_content() { - return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content' ) ), $this->object, $this ); + return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content', $this->get_default_additional_content() ) ), $this->object, $this ); } /**