check if taxonomy query exists and append if exists

This commit is contained in:
Bilal Catic
2018-10-14 16:03:05 +02:00
parent 9f3fe44bb1
commit 55dc87e174

View File

@@ -32,13 +32,16 @@ class Wiaas_Package {
return;
}
$query['tax_query'] = array(
if (!isset($query['tax_query'])){
$query['tax_query'] = array();
}
$query['tax_query'][] =
array(
'taxonomy' => 'package_status',
'field' => 'name',
'terms' => Wiaas_Package_Status::AVAILABLE
)
);
);
return $query;
}