Had this is main member plugin but now moving it into the wmta theme.
This will add to the member search sql when searching the site.
So we can add city name search results.
function new_mail_from_name($old) {
return 'WMTA';
}
+
+add_filter('glm-member-db-front-search-query', function( $queryParts ){
+ if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
+ $textSearch = addslashes(filter_var($_REQUEST['s'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+ $queryParts[] = " (
+ (
+ SELECT true
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
+ WHERE id = T.member
+ AND name LIKE '%$textSearch%'
+ )
+ OR T.descr LIKE '%$textSearch%'
+ OR T.city IN ( SELECT id FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities WHERE name LIKE '%$textSearch%' )
+ )";
+ }
+ return $queryParts;
+});
function display_memberfindme_directory() {
// Show MemberFindMe shortcode from Directory page
- $_REQUEST['textSearch'] = $_REQUEST['s'];
+ //$_REQUEST['textSearch'] = $_REQUEST['s'];
$_REQUEST['action'] = 'list';
$_REQUEST['event_name'] = $_REQUEST['s'];
echo do_shortcode('[glm-members-list view="grid" ]');
Author: Underscores.me
Author URI: http://underscores.me/
Description: Description
-Version: 1.0.16
+Version: 1.0.17
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wmta