bugfix in get_related() - return trash posts

This commit is contained in:
darkrain 2014-06-24 13:11:10 +07:00
parent ea476af2ca
commit 8f530a156c
1 changed files with 2 additions and 2 deletions

View File

@ -1217,8 +1217,8 @@ class WC_Product {
// when query is OR - need to check against excluded ids again
if ( apply_filters( 'woocommerce_product_related_posts_relate_by_tag', true, $this->id ) ) {
$query['where'] .= " {$andor} ( tt.taxonomy = 'product_tag' AND t.term_id IN ( " . implode( ',', $tags_array ) . " ) )";
$query['where'] .= " AND p.ID NOT IN ( " . implode( ',', $exclude_ids ) . " )";
$query['where'] .= " {$andor} ( ( tt.taxonomy = 'product_tag' AND t.term_id IN ( " . implode( ',', $tags_array ) . " ) )";
$query['where'] .= " AND p.ID NOT IN ( " . implode( ',', $exclude_ids ) . " ) )";
}
$query['orderby'] = " ORDER BY RAND()";