HUSKY - Product Filter for WooCommerce

woof_ext_custom_title_by_onsales

允许自定义“促销”筛选复选框在前端视图及JavaScript本地化数组中显示的标签文本。

参数

$label (string) — 默认翻译的标签字符串,通常为“促销”

源文件

ext/by_onsales/index.php:20

ext/by_onsales/views/woof.php:7

代码示例


add_filter('woof_ext_custom_title_by_onsales', function($label) {
    return __('Special Offers', 'my-theme');
});

使用说明

  • 在以下两处生效:index.php 通过 self::$includes 设置 js_lang_custom;views/woof.php 设置 $woof_ext_onsales_label 用于渲染。
  • 默认值为“促销”的翻译。
  • 属于扩展系统的一部分,其中 $this->index = 'onsales' 决定了JS键。