Automattic\WooCommerce\Internal\StockNotifications\Emails

CustomerStockNotificationVerifiedEmail::maybe_setup_notification_locale │ private │ WC 1.0

Setup notification locale if necessary based on notification meta.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->maybe_setup_notification_locale( $notification );
$notification(Notification) (обязательный)
Notification object.

Код CustomerStockNotificationVerifiedEmail::maybe_setup_notification_locale() WC 11.2.2

private function maybe_setup_notification_locale( $notification ) {
	$customer_locale = $notification->get_meta( '_customer_locale' );
	if ( ! empty( $customer_locale ) ) {
		switch_to_locale( $customer_locale );
	}
}