Automattic\WooCommerce\Internal\Admin\EmailPreview

EmailPreview::switch_to_site_localeprivateWC 1.0

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() code WC 10.7.0

private function switch_to_site_locale() {
	if ( ! $this->locale_switched ) {
		wc_switch_to_site_locale();
		$this->locale_switched = true;
	}
}