What I am constructing
I am developping a plugin. I am at present filtering the posts by tags and classes (
category_name WP_Query parameters) with values given in a shortcode. I need to add the chance to filter by customized taxonomy too.
What I do know (right me if I am fallacious)
- Once I use
tax_queryparameters in a WP_Query, the relation is AND between them.
- Once I set an empty string as worth for
cat, the question ignores it.
tax_querycan have AND and OR relation varieties set within it.
- Is it good to make use of all three parameters collectively in time period of velocity and optimization? Or is it finest to make use of solely
tax_query(or is it the identical ?).
- Can I take advantage of
tax_queryjust for that question? My classes and tags values might be empty strings when the consumer do not need to filter by these taxonomies.
- If 2. reply’s is sure, what ‘taxonomy’ worth ought to I enter for class and tags taxonomies ?