Forums › Forums › Search & Filter Pro › Passing data to shortcode when displaying the filter form
Tagged: custom taxonomy, shortcode, V3
- This topic has 3 replies, 2 voices, and was last updated 5 years, 7 months ago by Trevor.
-
Anonymous(Private) April 23, 2019 at 2:50 pm #209004
I have a situation where I am displaying custom posts based on location (which is defined by a custom taxonomy).
I have create the ability to switch between locations, and would like to display posts and a filter that is locked to that location.
The archive page for the custom post page is displaying results for the selected location, and I’m using the shortcode to display the filter form. I know that when you are setting up a form, you can specify to display ONLY posts from X taxonomy under the Tags, Categories & Taxonomies tab, but is there a way to pass a dynamically generated id instead of specifying it there? Ideally by adding a variable to the shortcode or by outputting the form with a PHP function.
Right now, I could create a separate form for each location, but that seems like a nightmare to maintain and requires manual intervention every time a new location is added.
Trevor(Private) April 23, 2019 at 3:27 pm #209019Please note that, as your license appears to have expired recently, you will first need to renew/complete the license/purchase to receive updates or support.
You have it correct. There is no way to dynamically pass the variable in advance of the results being filtered.
-
AuthorPosts