function hide_empty_category( $arg ){
$arg[ 'hide_empty' ] = 1;
return $arg;
}
add_filter( 'woocommerce_product_categories_widget_args', 'hide_empty_category' )
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' )