Merge pull request #5003 from splashingpixels/coupon

wc_get_product_ids_on_sale should never return post id of 0 fixes #5002
This commit is contained in:
Mike Jolley 2014-03-03 10:52:28 +00:00
commit ab3ebfd818
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ function wc_get_product_ids_on_sale() {
GROUP BY post.ID;
" );
$product_ids_on_sale = array_unique( array_map( 'absint', array_merge( wp_list_pluck( $on_sale_posts, 'ID' ), wp_list_pluck( $on_sale_posts, 'post_parent' ) ) ) );
$product_ids_on_sale = array_unique( array_map( 'absint', array_merge( wp_list_pluck( $on_sale_posts, 'ID' ), array_diff( wp_list_pluck( $on_sale_posts, 'post_parent' ), array( 0 ) ) ) ) );
set_transient( 'wc_products_onsale', $product_ids_on_sale );