Skip to content

Commit

Permalink
Rest of the usorts fixed to return 1 or 0 like the one fixed before
Browse files Browse the repository at this point in the history
  • Loading branch information
tim0haapala authored and Nomafin committed Jan 23, 2023
1 parent 747ea51 commit ce2c5ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Search/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit ce2c5ba

Please sign in to comment.