Tell us what you are trying to do?
I have a view which I intend to use for many use-cases and pass taxonomy arguments into the shortcode like so
[wpv-view name="resources" resource-cat="catname1,catname2" resource-tag="tagname1,tagname2"]
This works wonderfully. However, what is the best way to make this so that we can pass through an exclude argument like so:
[wpv-view name="resources" resource-cat="catname1,catname2" resource-tag="tagname1,tagname2" resource-cat-exclude="catname3" resource-tag-exclude="tagname3"]
It doesn't make sense to have to create many different views for many different selections, this is the best way I can see it being done so its strange this isn't something out of the box.
Hello,
In above example shortcode you mentioned above, you are using attribute: resource-tag="tagname1,tagname2", so it has already excluded other resource-tag terms, so it does not make sense to add "resource-tag-exclude" attribute.
Is there any special reason?
Yes, good question. Let's say I want to display two rows of resources:
Row 1 contains content from: "Category 1"
Row 2 contains content from: "Category 1" and "Tag 1"
Row 1 still would pull in similar content as Row 2 just because they're of the same category, but I need Row 1 to exclude anything from "Category 1" and "Tag 1". So it would be helpful to allow an exclude option here.
Unfortunately, there isn't such kind of built-in feature with Toolset plugins, you might consider custom codes, for example, use wpv_filter_query to trigger a PHP function, and add custom taxonomies filters into your view, more help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters