HUSKY - Product Filter for WooCommerce

woof_text_filter_labels

Filters the array of label slugs assigned to a product in the Husky text search, allowing customization of which labels are displayed for each search result.

Parameters

$labels (array) — Array of label string slugs that were matched for the current product post ID

Source File

ext/by_text/index.php:1098

Code Example

add_filter('woof_text_filter_labels', function($labels) {
    // Remove a label from display
    return array_values(array_diff($labels, ['hidden-label']));
});

Usage Notes

  • Called from the private get_labels() method for each product in Husky search results.
  • Labels are defined in the plugin's options under 'for_labels' setting.
  • Labels are typically used as badges or tags on search result items.