Forums › Forums › Search & Filter Pro › Custom querystring is remove on filter
Tagged: query string custom query
- This topic has 3 replies, 2 voices, and was last updated 6 years, 1 month ago by
Trevor.
-
Anonymous(Private) October 22, 2020 at 3:20 pm #263751
Hallo,
We have a piece of code that checks for a custom query string added in the url from another page.
Our code that works:
function filter_shop_tags($query_args, $sfid) { if ($sfid==112 && isset($_GET['shop-tag']) && !empty($_GET['shop-tag'])) { $query_args['tax_query'] = array( array( 'taxonomy' => 'shop_tag', 'field' => 'slug', 'terms' => array( $_GET['shop-tag'] ), ), ); } return $query_args; } add_filter('sf_edit_query_args', 'filter_shop_tags', 20, 2);The anchor from another page is example.com/shops/?shop-tag=exampleTag.
On the shops page we have the S&F filter. (Which is correctly filtered with the function). But when we try to active another filter with S&F. Another taxonomy for example it remove the ?shop-tag query string and turns into example.com/shops/?shop-taxonomy=exampleTax, but my wish would be: example.com/shops/?shop-tag=exampleTag&shop-taxonomy=exampleTax
regards
Trevor(Private) October 22, 2020 at 3:33 pm #263754I think maybe the reply Ross made on this thread might be what you are looking for:
https://support.searchandfilter.com/forums/topic/pass-textinput-ass-url-parameter/#post-263700
-
AuthorPosts