From 6fd823dabd7203dacdf7606aa39ad2d803175080 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 11 Oct 2013 13:25:34 +0100 Subject: [PATCH] get_children should get published products only for grouped products. Closes #3880. @coenjacobs This should go in .15 --- includes/class-wc-product-grouped.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/class-wc-product-grouped.php b/includes/class-wc-product-grouped.php index 740aa1a6eda..bb5ea1f99f9 100644 --- a/includes/class-wc-product-grouped.php +++ b/includes/class-wc-product-grouped.php @@ -92,10 +92,9 @@ class WC_Product_Grouped extends WC_Product { if ( false === ( $this->children = get_transient( $transient_name ) ) ) { - $this->children = get_posts( 'post_parent=' . $this->id . '&post_type=product&orderby=menu_order&order=ASC&fields=ids&post_status=any&numberposts=-1' ); + $this->children = get_posts( 'post_parent=' . $this->id . '&post_type=product&orderby=menu_order&order=ASC&fields=ids&post_status=publish&numberposts=-1' ); set_transient( $transient_name, $this->children ); - } }