Fixed missing initial $query = array()
This commit is contained in:
parent
82f381df67
commit
e87aefc8e0
|
@ -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)";
|
||||
|
|
Loading…
Reference in New Issue