Skip to content

Commit

Permalink
Adds filter for product categories displayed by product_categories
Browse files Browse the repository at this point in the history
…shortcode.
  • Loading branch information
outis authored and mikejolley committed Jan 31, 2019
1 parent effa518 commit 64c76ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/class-wc-shortcodes.php
Expand Up @@ -174,7 +174,10 @@ public static function product_categories( $atts ) {
'child_of' => $atts['parent'],
);

$product_categories = get_terms( 'product_cat', $args );
$product_categories = apply_filters(
'woocommerce_product_categories',
get_terms( 'product_cat', $args )
);

if ( '' !== $atts['parent'] ) {
$product_categories = wp_list_filter( $product_categories, array(
Expand Down

0 comments on commit 64c76ee

Please sign in to comment.