Skip to content

Instantly share code, notes, and snippets.

@mrkkr
Created April 25, 2018 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkkr/4dce4205b5dc06af65f7eda72f900378 to your computer and use it in GitHub Desktop.
Save mrkkr/4dce4205b5dc06af65f7eda72f900378 to your computer and use it in GitHub Desktop.
Hide default woocommerce category from product category widget #php
<?php
/* hide uncategorized product category */
add_filter( 'woocommerce_product_categories_widget_args', 'custom_woocommerce_product_subcategories_args' );
function custom_woocommerce_product_subcategories_args( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment