Forums › Forums › Search & Filter Pro › Get current form ID
- This topic has 6 replies, 3 voices, and was last updated 5 years, 4 months ago by
Trevor.
Viewing 7 posts - 1 through 7 (of 7 total)
-
Ross Moderator(Private) February 20, 2020 at 9:33 am #234436
Hi Mike
This is actually possible, it’s stored inside the query:
$query->query_vars['search_filter_id']
🙂
Anonymous(Private) February 25, 2020 at 12:16 pm #234825Oh!
So this is probably more of a noob PHP question, how would i echo that data/number out in to a field?
Im trying to hardcode a the Reset field in to a theme:
<a href="#" class="search-filter-reset" data-search-form-id="FILTER ID" data-sf-submit-form="always">Clear all</a>
Anonymous(Private) February 25, 2020 at 1:21 pm #234831Ah that was the first thing i tried before coming back here. It didnt output anything.
Im probably outside of the initial query/loop for the filters, is there another way to call it while outside?
<?php echo do_shortcode('[searchandfilter slug="' . $page_type . '"]'); ?> <a href="#" class="search-filter-reset" data-search-form-id="<?php echo $query->query_vars['search_filter_id'];?>" data-sf-submit-form="always">Clear all</a>
-
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)