HUSKY - Product Filter for WooCommerce

woof_ext_custom_title_by_featured

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

参数

$label (string) — 默认翻译的标签字符串,通常为“特色产品”

源文件

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_lang_custom,views/woof.php 设置渲染后的 $woof_ext_featured_label 变量。
  • 默认值是“特色产品”的翻译。
  • 适用于为每个主题自定义筛选术语或进行白标命名。