HUSKY - Product Filter for WooCommerce

woof_ext_custom_title_by_featured

允许自定义在前端视图和 JavaScript 本地化数组中显示的“特色产品”过滤复选框的标签文本。

参数

$label (string) — 默认的翻译标签字符串,通常是“Featured products”

源文件

ext/by_featured/index.php:51

ext/by_featured/views/woof.php:7

代码示例


add_filter('woof_ext_custom_title_by_featured', function($label) {
    $custom_label = __('Top Picks', 'my-theme');
    return $custom_label;
});

使用说明

  • 在两个地方应用:index.php 为 JS 前端设置 js_lang_custom,views/woof.php 设置渲染的 $woof_ext_featured_label 变量。
  • 默认值是“Featured products”的翻译。
  • 适用于按主题进行白标或自定义过滤术语。