woof_html_types_view_radio
自版本 2.2.4/1.2.4 起
使用此钩子可以重写文件视图:\views\html_types\radio.php
参数
$html (string) — the template HTML, $term_data (array) — term data
源文件
views/html_types/radio.php
代码示例
add_filter('woof_html_types_view_radio', function($html, $term_data) {
// Style radio buttons as beautiful chips/pills
$custom = '';
$custom .= $html;
$custom .= '';
return $custom;
}, 10, 2);
使用说明
- 将这段代码添加到你的主题的
functions.php文件或自定义插件中。 - 该钩子在筛选过程中被应用——更改会立即生效。
- 始终从回调函数返回预期的值类型。