Automattic\WooCommerce\Internal\StockNotifications\Emails
CustomerStockNotificationVerifyEmail::maybe_setup_notification_locale
Setup notification locale if necessary based on notification meta.
Method of the class: CustomerStockNotificationVerifyEmail{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->maybe_setup_notification_locale( $notification );
- $notification(Notification) (required)
- Notification object.
CustomerStockNotificationVerifyEmail::maybe_setup_notification_locale() CustomerStockNotificationVerifyEmail::maybe setup notification locale code WC 10.3.6
private function maybe_setup_notification_locale( $notification ) {
$customer_locale = $notification->get_meta( '_customer_locale' );
if ( ! empty( $customer_locale ) ) {
switch_to_locale( $customer_locale );
}
}