HUSKY - Product Filter for WooCommerce

woof_html_types_view_mselect

从版本2.2.4/1.2.4开始

使用此钩子可以重写文件视图:\views\html_types\mselect.php

 

参数

$html (string) — the template HTML, $term_data (array) — term data

源文件

views/html_types/mselect.php

代码示例


add_filter('woof_html_types_view_mselect', function($html, $term_data) {
    // Add a placeholder option to multi-select
    $placeholder = '';
    return $placeholder . $html;
}, 10, 2);

使用说明

  • 将此代码添加到您主题的functions.php文件或自定义插件中。
  • 该钩子在筛选过程中应用——更改会立即生效。
  • 始终从回调函数返回预期的值类型。