Updating member search.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 8 Jun 2018 13:46:02 +0000 (09:46 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 8 Jun 2018 13:46:02 +0000 (09:46 -0400)
Use SOUNDS LIKE as well as LIKE to get matches for search.

functions.php
style.css

index e484879..d8554de 100644 (file)
@@ -416,13 +416,19 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ){
                 SELECT true
                   FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
                  WHERE id = T.member
-                   AND name LIKE '%$textSearch%'
-            )
+                   AND (
+                        name SOUNDS LIKE '%$textSearch%'
+                     OR name LIKE '%$textSearch%'
+                    )
+                )
+            OR T.descr SOUNDS LIKE '%$textSearch%'
             OR T.descr LIKE '%$textSearch%'
             OR T.city IN (
                 SELECT id
                   FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities
-                 WHERE name LIKE '%$textSearch%' )
+                 WHERE name SOUNDS LIKE '%$textSearch%'
+                    OR name LIKE '%$textSearch%'
+            )
         )";
     }
     return $queryParts;
index 2416904..c117ee6 100644 (file)
--- a/style.css
+++ b/style.css
@@ -4,7 +4,7 @@ Theme URI: http://underscores.me/
 Author: Underscores.me
 Author URI: http://underscores.me/
 Description: Description
-Version: 1.0.24
+Version: 1.0.25
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: wmta