1

Okay... so here is what I'm trying to do. Basically all of the components that make up any particular page on a Wordpress site, I need to be able to grab the query that WP is running to grab the data for that particular area of the given page. So, if we have page A, let's say it has a top navigation, main content section, and footer. Each of these three areas have content that is pulled from the database. I need a generic way to say on page X I want to know what queries have been ran to generate all of the content pulled from the database and displayed on the page.

I feel like the key is to properly use https://codex.wordpress.org/Class_Reference/WP_Query to get the data I need.

Any thoughts on how I could go about this?

Brad Mash
  • 69
  • 6
  • Possible duplicate of [Get all instances of a class in PHP](http://stackoverflow.com/questions/475569/get-all-instances-of-a-class-in-php) – rnevius Oct 05 '15 at 20:19
  • This is no where near a duplicate of that thread. That thread wasn't even talking about Wordpress and we are dealing with Wordpress classes/objects ... not to mention multiple different types of classes as opposed to in that thread all of the same type. Also, I'm assuming he is not bound to a framework since his question was general... Wordpress has a framework in place that I would like to take advantage of if there is an easy way to do this with the WP API. – Brad Mash Oct 05 '15 at 23:48
  • WordPress classes are PHP classes. There's nothing special about doing this in WordPress versus plain PHP. – rnevius Oct 06 '15 at 15:31
  • I can agree with that, but what I'm asking is if there are API functions which utilize these underlying classes to abstract away dealing with the classes directly. – Brad Mash Oct 06 '15 at 19:40

0 Answers0