From 3902c0e04ac8889d4e0cc5ba53451600f9cceed3 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 10 Apr 2017 14:19:55 -0400 Subject: [PATCH] Update the apply filters part for member list model. To get the correct whereSep --- models/front/members/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/front/members/list.php b/models/front/members/list.php index 2ea2c54e..778d0758 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -171,7 +171,6 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo $nextStart = false; $start = 1; $limit = $this->config['settings']['list_pagination_count']; // Now this is in management - // Check for URL parameter override of shortcode parameters if (isset($_REQUEST['categorySearch'])) { $actionData['request']['category-search'] = $_REQUEST['categorySearch']; @@ -599,6 +598,12 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo } // if doing amenity search $amenityData = ( is_array( $amenityData ) ) ? array_filter( $amenityData ) : array(); + $whereParts = apply_filters('glm-member-db-front-search-query', $where); + if ( is_array( $whereParts ) && count( $whereParts ) > 0 ) { + $where .= $whereSep.implode(" AND ", $whereParts); + $whereSep = ' AND '; + } + // Only look at active member information where the member is displayable (access = 20, 30, 40) $where .= $whereSep." ( @@ -673,7 +678,6 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo $resultParam = 'list'; } - $where = apply_filters('glm-member-db-front-search-query', $where); /* * Get a current list of members - unless this is a blank start -- 2.17.1