Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@peltopiri
Last active April 11, 2019 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save peltopiri/76e7d1143e33b424633114103cfae5ec to your computer and use it in GitHub Desktop.
Save peltopiri/76e7d1143e33b424633114103cfae5ec to your computer and use it in GitHub Desktop.
WooCommerce hide/exclude categories from category widget
<?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