HUSKY - Product Filter for WooCommerce

woof_subscribe_lang

为“产品信使”扩展筛选订阅语言文本,支持自定义与每个产品提醒订阅一同存储的语言/区域设置字符串。

参数

$lang (string) — 当前订阅语言字符串,来自 $this->subscribe_lang 属性

源文件

ext/products_messenger/index.php:326

代码示例

add_filter('woof_subscribe_lang', function($lang) {
    // Force a specific locale for subscriptions
    return 'en_US';
});

使用说明

  • 在 AJAX 订阅创建过程中使用。
  • subscribe_lang 值作为订阅数据的一部分存储在用户元数据中。
  • 属于“产品信使”扩展,用于用户产品提醒。