Skip Navigation

[Resolved] where (in my site or in plugin files) can I find the Views-generated php?

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to know how to inspect the WP_Query produced by a View. Where can I find the PHP files that contain the query?

Solution: There is no PHP file that contains the query for each View. To inspect the WP_Query parameters produced by a View you can use the Views debug tool. Go to Toolset > Settings > Frontend Content and turn on Views Debug. Then reload the page that contains the View on the front-end of your site. You may need to disable your browser's popup blocker to see the debug window.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

This support ticket is created 4 years, 10 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Joe H. 4 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1245470

Tell us what you are trying to do?

I've created a rather clever View and I would like to see the php for it so that I can understand it better. This is for my own eduction and learning, not to solve a problem. Specially I am looking for the WP_Query call being used in my View. Can the php that Views creates be viewed in the Views plugin directories? I can't seem to find where this is being stored.

On this page I created a rough mock up of a Post Archive where there are 2 static CTA's inside the loop. As new posts are added, or as the loop is filtered by category, the existing posts rearrange around these 2 CTA's which are fixed in place.
hidden link

Thanks

#1245482

Hi, you can use the Views debug tool to see details about the WP_Query that corresponds to any View. Go to Toolset > Settings > Front-end Content to activate the debug tool, then visit any page on your site that displays the View. If the popup does not appear automatically, you must deactivate your browser's popup blocker. Then refresh the page and you'll see the debug popup window. You can toggle open the different sections to display more information about the SQL queries used to generate the results of each View shown on the page. Don't forget to disable the debug tool once you're finished inspecting the query.

More debug information:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#1245529

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.