Skip Navigation

[Resuelto] Still no ability to use OR in a Query Filter on a View. Why not?

This support ticket is created hace 8 meses, 3 semanas. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 respuestas, has 2 mensajes.

Last updated by Simon hace 8 meses, 3 semanas.

Autor
Mensajes
#2360769

I am trying to:
- Filter a View when a shortcode attribute matches the content of one of two text fields

Link to a page where the issue can be seen:
- hidden link

Each of the 'More books by' Views should list books by both authors.

The problem of missing OR filtering has been around for ages. Why has this not been fixed? Don't you love Views any more?

And in the short term, what's the best current workaround because I can't find it via the search.

#2360779

Nigel
Supporter

Languages: Inglés (English ) Español (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I'm afraid we aren't privy to the developer deliberations when it comes to prioritising issues to work on, though I suspect in this case the ready availability of a workaround would make it appear less urgent.

The erratum links to the documentation for the wpv_filter_query hook that can be used to overwrite the View arguments, and I've edited it now to include a code sample of what you might use: https://toolset.com/errata/and-always-used-with-multiple-views-query-filters-even-if-or-is-specified/

#2360781

The workaround works but I am still grumpy about it. Having to build an array of View IDs isn't exactly intuitive...