Tell us what you are trying to do?
I need to build a range of queries, some of which are quite complex with filtering. I do however need more flexability to use the query results outside of the views.
Hello,
Views plugin is using WordPress class WP_query to query posts, so you can follow WordPress document to setup your own complex query manually:
https://codex.wordpress.org/Class_Reference/WP_Query
You can also use Views plugin to query posts, and customize filters to view by using API hook "wpv_filter_query", see our document:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
Hi Luo,
Thank you for getting back to me.
I'm aware that I could manually create the query and filters or create them within toolset views. What I meant is, is it possible to view the WP_Query of a view created within toolset?
Thanks
Ben
Dear Ben,
Yes, you can try this:
Dashboard-> Toolset-> Settings-> Front-end Content,
in section "Debug mode", enable options:
- Enable Views debug mode
- Full debug mode
Then test your view in front-end, it should be able to popup a debug window, there you can get the WP_Query parameters