Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::switch_to_site_locale
Switch to the site locale. This is to ensure the email is displayed in the store's language, as the customer would see it, not the admin's language.
Method of the class: EmailPreview{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->switch_to_site_locale();
EmailPreview::switch_to_site_locale() EmailPreview::switch to site locale code WC 10.7.0
private function switch_to_site_locale() {
if ( ! $this->locale_switched ) {
wc_switch_to_site_locale();
$this->locale_switched = true;
}
}