Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created December 19, 2012 00:39
Show Gist options
  • Save claudiosanches/4333440 to your computer and use it in GitHub Desktop.
Save claudiosanches/4333440 to your computer and use it in GitHub Desktop.
WooCommerce - Show empty product categories.
<?php
/**
* WooCommerce - Show empty product categories.
*
* @param array $args Default widget argument.
*
* @return array New arguments with hide_empty.
*/
function wc_show_empty_categories( $args ) {
$args['hide_empty'] = 0;
return $args;
}
add_filter( 'woocommerce_product_categories_widget_args', 'wc_show_empty_categories' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment