From bcb54f1d425bff49bbe46854cfcdd4e4d67d2e00 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 26 Apr 2017 15:55:33 -0400 Subject: [PATCH] Updating the search params for next and prev links. Need to pass the manufacturers and the categorySearchMultiple arrays. --- functions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/functions.php b/functions.php index e4a8056..e154811 100644 --- a/functions.php +++ b/functions.php @@ -81,6 +81,22 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { $orderBy .= ", $originalOrderBy DESC "; return $orderBy; }); +add_filter('glm-member-db-fields-front-list-query-params', function( $query ){ + $queryParams = array(); + // Check for manufactures + if ( isset( $_REQUEST['manufacturers'] ) && is_array( $_REQUEST['manufacturers'] ) ) { + foreach ( $_REQUEST['manufacturers'] as $man ) { + $queryParams[] = "manufacturers[]={$man}"; + } + } + // This needs to be done for now until it is in the main plugin. + if ( isset( $_REQUEST['categorySearchMultiple'] ) && is_array( $_REQUEST['categorySearchMultiple'] ) ) { + foreach ( $_REQUEST['categorySearchMultiple'] as $cat ) { + $queryParams[] = "categorySearchMultiple[]={$cat}"; + } + } + return ( !empty( $queryParams ) ? $query . '&'.implode( '&', $queryParams): $query); +},10, 1); add_filter('glm_blocks', function() { if(function_exists('fetch_all_glm_blocks')) { $blocks = fetch_all_glm_blocks(); -- 2.17.1