woof_before_term_name
Uses in html types as: radio, checkbox, select, mselect for printing any symbols or icons before its label
wp-content\plugins\woocommerce-products-filter\views\html_types\checkbox.php
Parameters
$term (string) — the term name, $taxonomy_info (array) — taxonomy data
Source File
views/html_types/checkbox.php, radio.php, select.php
Code Example
add_filter('woof_before_term_name', function($term, $taxonomy_info) {
// Add a custom icon or badge before the term name
$icon = '';
if (isset($taxonomy_info->taxonomy) && $taxonomy_info->taxonomy === 'product_cat') {
$icon = ' ';
}
return $icon . $term;
}, 10, 2);
Usage Notes
- Add this code to your theme's
functions.phpfile or a custom plugin. - The hook is applied during the filtering process — changes take effect immediately.
- Always return the expected value type from the callback function.
