Fixed missing initial $query = array()

This commit is contained in:
claudiosmweb 2014-11-19 16:26:10 -02:00
parent 82f381df67
commit e87aefc8e0
1 changed files with 1 additions and 0 deletions

View File

@ -1160,6 +1160,7 @@ class WC_Product {
$exclude_ids = array_map( 'absint', array_merge( array( 0, $this->id ), $this->get_upsells() ) );
// Generate query
$query = array();
$query['fields'] = "SELECT DISTINCT ID FROM {$wpdb->posts} p";
$query['join'] = " INNER JOIN {$wpdb->postmeta} pm ON ( pm.post_id = p.ID AND pm.meta_key='_visibility' )";
$query['join'] .= " INNER JOIN {$wpdb->term_relationships} tr ON (p.ID = tr.object_id)";