From ce2c5ba7164275a69652384df9b91fde3a7aab5e Mon Sep 17 00:00:00 2001 From: Timo Haapala Date: Fri, 20 Jan 2023 13:05:34 +0200 Subject: [PATCH] Rest of the usorts fixed to return 1 or 0 like the one fixed before --- src/Search/QueryBuilder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Search/QueryBuilder.php b/src/Search/QueryBuilder.php index 694c8dd..bb06cee 100644 --- a/src/Search/QueryBuilder.php +++ b/src/Search/QueryBuilder.php @@ -666,7 +666,7 @@ public function create_taxonomy_query( array $query, string $operator = 'AND', b // All minuses to the end of the line. usort( $queries, function( $a, $b ) { - return ( substr( $a, 0, 1 ) === '-' ); + return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0; }); // Compare the relation. @@ -770,7 +770,7 @@ protected function create_meta_query( array $query, string $operator = 'AND' ) : // All minuses to the end of the line. usort( $queries, function( $a, $b ) { - return ( substr( $a, 0, 1 ) === '-' ); + return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0; }); $queries = array_filter( $queries, function( $query ) { @@ -817,7 +817,7 @@ protected function create_meta_query( array $query, string $operator = 'AND' ) : // All minuses to the end of the line. usort( $queries, function( $a, $b ) { - return ( substr( $a, 0, 1 ) === '-' ); + return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0; }); $queries = array_filter( $queries, function( $query ) {