woof_filter_taxonomies
Filters the array of product taxonomies retrieved from WordPress, allowing removal or modification of taxonomies used by the filter.
Parameters
$taxonomies (array) — Array of taxonomy objects returned by get_object_taxonomies('product', 'objects'), with 'product_shipping_class' and 'product_type' already removed
Source File
index.php:1394
Code Example
add_filter('woof_filter_taxonomies', function($taxonomies) {
// Remove a specific taxonomy from filtering
if (isset($taxonomies['pa_color'])) {
unset($taxonomies['pa_color']);
}
return $taxonomies;
});
Usage Notes
- Called in get_taxonomies() method which is static-cached.
- product_shipping_class and product_type are unset by default before the filter runs.
- Useful for hiding custom taxonomies from the filter panel.