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”与“Stock Quantity”。
  • 来自 index.php 的结果还会额外通过 WOOF_HELPER::wpml_translate()。