HUSKY - Product Filter for WooCommerce

woof_ext_custom_title_stock_quantity

允许自定义“库存数量滑块”筛选器的标签文本,该标签显示在管理员筛选标题列表和前端视图模板中。

参数

$label (string) — 默认翻译的标签字符串,通常为 'Stock quantity slider' 或 'Stock Quantity'

源文件

ext/stock_quantity/index.php:62

ext/stock_quantity/views/woof.php:107

代码示例


add_filter('woof_ext_custom_title_stock_quantity', function($label) {
    return __('Inventory Level', 'my-theme');
});

使用说明

  • 在两个地方使用:index.php中的add_titles()方法(挂载于woof_get_all_filter_titles钩子),以及前端显示的views/woof.php。
  • 默认值在不同调用位置略有不同:'Stock quantity slider' vs 'Stock Quantity'。
  • 来自index.php的结果还会额外经过WOOF_HELPER::wpml_translate()处理。