Skip to content

Commit

Permalink
🐛 Continue on empty search string
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldangenent committed Jun 2, 2017
1 parent 5b80958 commit e50afd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Hook/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public function search($sql, WP_Query $query)

$searches = array_filter($searches);

if (count($searches) === 0) {
continue;
}

$search = '(' . implode($or, $searches) . ')' . $or;

$clause = preg_replace('/' . $or . '/', $or . $search, $clause, 1);
Expand Down

0 comments on commit e50afd0

Please sign in to comment.