Skip to content

Instantly share code, notes, and snippets.

@doublecompile
Created August 22, 2018 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doublecompile/3d01da42aa82b13239b3de738be679bf to your computer and use it in GitHub Desktop.
Save doublecompile/3d01da42aa82b13239b3de738be679bf to your computer and use it in GitHub Desktop.
Fixes Search Everything problem
diff --git a/wp-content/plugins/search-everything/search-everything.php b/wp-content/plugins/search-everything/search-everything.php
index d39281c5..a3fa4d63 100644
--- a/wp-content/plugins/search-everything/search-everything.php
+++ b/wp-content/plugins/search-everything/search-everything.php
@@ -275,7 +275,8 @@ class SearchEverything {
$searchQuery .= $this->se_search_authors();
}
- if ( $searchQuery != '' ) {
+ $searchQuery = trim($searchQuery);
+ if ( $searchQuery != '' && $searchQuery != '()' ) {
// lets use _OUR_ query instead of WP's, as we have posts already included in our query as well(assuming it's not empty which we check for)
$where = " AND ((" . $searchQuery . ")) ";
}
@@ -933,4 +934,3 @@ function se_post_publish_ping($post_id) {
}
add_action( 'publish_post', 'se_post_publish_ping' );
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment