woof_ext_custom_title_by_onsales
允许自定义在前端视图和 JavaScript 本地化数组中显示的“促销中”过滤复选框的标签文本。
参数
$label (string) — 默认的翻译标签字符串,通常是“On sale”
源文件
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 用于渲染。
- 默认值是“On sale”的翻译。
- 扩展系统的一部分,其中 $this->index = 'onsales' 决定了 JS 键。