Created
April 19, 2014 17:38
-
-
Save goliver79/11091523 to your computer and use it in GitHub Desktop.
[WOOCOMMERCE] Hide empty categories in Woocommerce Widget Product Categories
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 | |
/* | |
* @goliver79 | |
* woocommerce hide empty categories in woocommerce widget "product categories" | |
*/ | |
function woo_hide_product_categories_widget( $list_args ){ | |
$list_args[ 'hide_empty' ] = 1; | |
return $list_args; | |
} | |
add_filter( 'woocommerce_product_categories_widget_args', 'woo_hide_product_categories_widget' ); |
Perfect! Great work.
Thank you,
is there any way how to apply this when the type of widget is dropdown menu?
Perfecto.. thanks
thanks - also needed this.
Hi guys, i'm new here and I need to apply this solution to my woocommerce but I don't know how to do it. Do I have to edit this file or create it? Where is located? Thanks :)
This is great.
Can you do the same with the main menu?
I need filter which move out empty menu categories.
Not working for me, Anyone can suggest me something?
Same here. Not working
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you! i need this