HUSKY - Products Filter Professional for WooCommerce

woof_before_term_name

woof_before_term_name

Позволяет вывести произвольный символ или иконку перед названием термина таксономии в HTML-типах: radio, checkbox, select, mselect.

Parameters

$term (string) — название термина, $taxonomy_info (array) — данные таксономии

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) AND $taxonomy_info->taxonomy === 'product_cat') {
        $icon = '📁 ';
    }
    return $icon . $term;
}, 10, 2);

Usage Notes

  • Add this code to your theme's functions.php file 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.