Automattic\WooCommerce\Internal\Admin\EmailPreview

EmailPreview::switch_to_site_locale │ private │ WC 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.

Метод класса: EmailPreview{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->switch_to_site_locale();

Код EmailPreview::switch_to_site_locale() WC 11.3.0

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