WC_Email::setup_locale()publicWC 1.0

Set the locale to the store locale for customer emails to make sure emails are in the store language.

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

Возвращает

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

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

$WC_Email = new WC_Email();
$WC_Email->setup_locale();

Код WC_Email::setup_locale() WC 8.7.0

public function setup_locale() {

	/**
	 * Filter the ability to switch email locale.
	 *
	 * @since 6.8.0
	 *
	 * @param bool $default_value The default returned value.
	 * @param WC_Email $this The WC_Email object.
	 */
	$switch_email_locale = apply_filters( 'woocommerce_allow_switching_email_locale', true, $this );

	if ( $switch_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_setup_locale', true ) ) {
		wc_switch_to_site_locale();
	}
}