From 064d814cd6b8c60376898b8e3b7a41a42c95736a Mon Sep 17 00:00:00 2001 From: Luigi Date: Thu, 27 Oct 2022 12:01:40 +0200 Subject: [PATCH] disable phcs rules on top of the file --- src/BlockTypes/ProductQuery.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BlockTypes/ProductQuery.php b/src/BlockTypes/ProductQuery.php index c20ef3debcb..ead5692be57 100644 --- a/src/BlockTypes/ProductQuery.php +++ b/src/BlockTypes/ProductQuery.php @@ -175,9 +175,9 @@ function( $acc, $query ) { * @return array */ private function merge_queries( $query1, $query2 ) { - $query1['post__in'] = isset( $query2['post__in'] ) ? $this->intersect_arrays_when_not_empty( $query1['post__in'], $query2['post__in'] ) : $query1['post__in']; - $query1['meta_query'] = isset( $query2['meta_query'] ) ? array_merge( $query1['meta_query'], array( $query2['meta_query'] ) ) : $query1['meta_query']; - $query1['tax_query'] = isset( $query2['tax_query'] ) ? array_merge( $query1['tax_query'], array( $query2['tax_query'] ) ) : $query1['tax_query']; + $query1['post__in'] = ( isset( $query2['post__in'] ) && ! empty( $query2['post__in'] ) ) ? $this->intersect_arrays_when_not_empty( $query1['post__in'], $query2['post__in'] ) : $query1['post__in']; + $query1['meta_query'] = ( isset( $query2['meta_query'] ) && ! empty( $query2['meta_query'] ) ) ? array_merge( $query1['meta_query'], array( $query2['meta_query'] ) ) : $query1['meta_query']; + $query1['tax_query'] = ( isset( $query2['tax_query'] ) && ! empty( $query2['tax_query'] ) ) ? array_merge( $query1['tax_query'], array( $query2['tax_query'] ) ) : $query1['tax_query']; return $query1;