Created
April 25, 2018 12:18
-
-
Save mrkkr/4dce4205b5dc06af65f7eda72f900378 to your computer and use it in GitHub Desktop.
Hide default woocommerce category from product category widget #php
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 | |
/* 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