Last active
April 11, 2019 12:28
-
-
Save peltopiri/76e7d1143e33b424633114103cfae5ec to your computer and use it in GitHub Desktop.
WooCommerce hide/exclude categories from category widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Exclude WC Product Categories */ | |
function peltopiri_exclude_wc_widget_categories($cat_args) { | |
$cat_args['exclude'] = array('16'); | |
return $cat_args; | |
} | |
add_filter('woocommerce_product_categories_widget_dropdown_args', 'peltopiri_exclude_wc_widget_categories'); | |
add_filter('woocommerce_product_categories_widget_args', 'peltopiri_exclude_wc_widget_categories'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment