From 62d078edf5eccede33c1c244dee93da38012dc59 Mon Sep 17 00:00:00 2001 From: "sergey.r" Date: Thu, 3 Aug 2017 14:58:44 +0300 Subject: [PATCH] Add filters to make possible send emails in language different from default --- includes/emails/class-wc-email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/emails/class-wc-email.php b/includes/emails/class-wc-email.php index 8bcf0660e8f..153a00d329c 100644 --- a/includes/emails/class-wc-email.php +++ b/includes/emails/class-wc-email.php @@ -263,7 +263,7 @@ class WC_Email extends WC_Settings_API { * Set the locale to the store locale for customer emails to make sure emails are in the store language. */ public function setup_locale() { - if ( $this->is_customer_email() ) { + if ( $this->is_customer_email() && apply_filters( 'woocommerce_email_setup_locale', true ) ) { wc_switch_to_site_locale(); } } @@ -272,7 +272,7 @@ class WC_Email extends WC_Settings_API { * Restore the locale to the default locale. Use after finished with setup_locale. */ public function restore_locale() { - if ( $this->is_customer_email() ) { + if ( $this->is_customer_email() && apply_filters( 'woocommerce_email_restore_locale', true ) ) { wc_restore_locale(); } }