ix: test if proprieties exist in filter arguments on using elasticpress
This commit is contained in:
parent
4eaa38f949
commit
f1fd8ee39f
|
@ -274,6 +274,8 @@ class Elastic_Press {
|
|||
|
||||
if( isset($args['tax_query']) ) {
|
||||
foreach( $args['tax_query'] as $taxquery ) {
|
||||
if ( !isset($tax['taxonomy']) || !isset($tax['terms']) )
|
||||
continue;
|
||||
if( $taxquery['taxonomy'] === $taxonomy_slug ) {
|
||||
$include = is_array($taxquery['terms']) ? $taxquery['terms'] : [$taxquery['terms']];
|
||||
}
|
||||
|
@ -288,6 +290,8 @@ class Elastic_Press {
|
|||
|
||||
if( isset($args['meta_query']) ) {
|
||||
foreach( $args['meta_query'] as $metaquery ) {
|
||||
if ( !isset($meta['key']) || !isset($meta['value']) )
|
||||
continue;
|
||||
if( isset($metaquery['key']) && $metaquery['key'] == $metadatum_id ){
|
||||
$include = is_array($metaquery['value']) ? $metaquery['value'] : [$metaquery['value']];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue