From 895397e7cac9b61fbac2c1981e512fe29288ba67 Mon Sep 17 00:00:00 2001 From: Rinat Khaziev Date: Thu, 27 Jan 2022 15:35:23 -0800 Subject: [PATCH] Fix a rare edge-case bug where invalid values in tax_query terms resulted in a broken query by passing terms array via array_filter to remove false and null --- includes/classes/Indexable/Post/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 354a255dc1..14921e81d7 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -1822,7 +1822,7 @@ protected function parse_tax_query( $query ) { // Set up our terms object $terms_obj = array( - 'terms.' . $single_tax_query['taxonomy'] . '.' . $field => $terms, + 'terms.' . $single_tax_query['taxonomy'] . '.' . $field => array_filter( $terms ), ); $operator = ( ! empty( $single_tax_query['operator'] ) ) ? strtolower( $single_tax_query['operator'] ) : 'in';